问题
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
- Starting both shell and thrift from same location
- 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