使用 Spark/Java Maven 项目获取 HiveContext

Get HiveContext using Spark/Java Maven project

我正在尝试使用 HiveContext 通过 Spark SQL 从 table 获取值。

但我不确定如何配置 Hive Metastore 详细信息并使其正常工作。

我们需要在 SparkContext() 上设置一些东西吗?

此致, 香卡

直接来自the documentation

HiveContext sqlContext = new org.apache.spark.sql.hive.HiveContext(sc.sc);

Configuration of Hive is done by placing your hive-site.xml file in conf/.

和示例hive-site.xml