【发布时间】:2021-09-20 09:13:16
【问题描述】:
我在尝试将数据附加到配置单元表时遇到了一些问题。 我正确地声明了会话:我可以从表中检索数据
SparkSession spark = SparkSession
.builder()
.appName("Java Spark SQL basic example")
.config("hive.metastore.uris", "thrift://localhost:9083")
.enableHiveSupport()
.master("local[*]")
.getOrCreate();
当尝试使用 df.write().mode(SaveMode.Append).saveAsTable("sample.test_table"); 附加一些数据时,我得到了
Exception in thread "main" java.lang.ClassNotFoundException: Failed to find data source: hive. Please find packages at http://spark.apache.org/third-party-projects.html
我错过了什么?
编辑:
使用 df.write().insertInto("prova2.test_table"); 有效,不知道它是如何工作的
【问题讨论】:
-
您使用的 spark 和 hive 版本是什么?
标签: java apache-spark hive apache-spark-sql spark-hive