spark读取Hive出错: Database 'test1' not found

错误:找不到数据库。

Exception in thread "main" org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException: Database 'test1' not found;

解决方案:

加上enableHiveSupport()即可,否则默认不读hive-site.xml。

val spark = SparkSession.builder().master("local[2]").appName("HiveJoinMySql").enableHiveSupport().getOrCreate()


猜你喜欢

转载自blog.csdn.net/bigdata_mining/article/details/80895084