Giving spark thrift server the path to warehouse directory

◇◆丶佛笑我妖孽 提交于 2020-01-03 19:16:13

问题


I have setup my spark cluster and I am successful in connecting Tableau through Spark SQL connector.

I created my tables from spark shell and saved dataframes from MySQL using (saveAsTable).

How can I access the tables that I have saved from Tableau? Do I need to give a path of the warehouse directory when starting the spark thrift server? If yes, how it can be done and if no, how can this be done?


回答1:


Make sure you are pointing to the same metastore for spark-shell and thriftserver

Metastore sharing can be 2 ways, in simple

  1. Starting both shell and thrift from same location
  2. Setting up remote database for metastore

You can pass hive confs to Spark thrift server with --hiveconf and Spark confs with --conf

./sbin/start-thriftserver.sh \
  --conf spark.sql.warehouse.dir=path/to/warehouse/dir \
  --hiveconf hive.server2.thrift.port=<listening-port> \
  --hiveconf hive.server2.thrift.bind.host=<listening-host> \
  --master <master-uri>
  ...


来源:https://stackoverflow.com/questions/45032770/giving-spark-thrift-server-the-path-to-warehouse-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!