Spark SQL to read the data in the library can not be found in the table Hive Cluster mode

SparkSQL hive using the read data in the table Spark On Hive, and the local client mode by tests, but in the yarn is thrown cluster model test following exception:

org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException: Database ‘test’ not found;

Finally, find out why: when the spark job jar into yarn run above cluster node may not perform the job Hive node is located. Hive will not find the configuration file, a database error can not find the cause.
So use --files the hive-site.xml broadcast to all nodes
spark-submit --master yarn --deploy-mode cluster --files ... / hive-site.xml - ...

Published 19 original articles · won praise 8 · views 4549

Guess you like

Origin blog.csdn.net/M283592338/article/details/100141577