且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Spark SQL中找不到Hive表 - Cloudera VM中的spark.sql.AnalysisException

更新时间:2021-09-09 05:48:10


  1. 使用SparkSession.enableHiveSupport()而不推荐使用SQLContext或HiveContext。

Several steps were needed.

/ li>

  • 将hive-site.xml复制到SPARK CONF(/ usr / lib / spark / conf)目录中
  • 执行时将相同的目录添加到classpath (感谢上面的Paul和Samson)

    1. Using SparkSession.enableHiveSupport() instead of deprecated SQLContext or HiveContext.
    2. copy hive-site.xml into SPARK CONF (/usr/lib/spark/conf) directory
    3. Adding the same directory to the classpath while executing the jar (Thanks to Paul and Samson above)