spark連接hive找不到table


Caused by: org.apache.spark.sql.catalyst.analysis.NoSuchTableException: Table or view 'xxxx' not found....

 

hive-site.xml需要配置 hive.metastore.uris  並啟動9083 thrift接口。

<property>
    <name>hive.metastore.uris</name>
    <value>thrift://127.0.0.1:9083</value>
    <description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
  </property>

  

啟動hive的metastroe:

hive --service metastore

  

 附sparsql代碼:

def main(args: Array[String]): Unit = {

    val spark: SparkSession = new SparkSession
      .Builder()
      .master("local")
//      master("spark://bogon:7077")
      .appName("kafka test")
      .config("spark.sql.warehouse.dir", "/user/hive/warehouse")
      .enableHiveSupport()
      .getOrCreate()

}

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM