I'm trying to expose my spark-sql tables over JDBC via thriftserver but even though it looks like i've successfully connected, its not working. Here's what I've tried so far.
database setup:
tableX
.saveAsTable
as hive_tableX
spark.sql("SELECT * FROM hive_tableX LIMIT 1").show()
which returned some data querying from spark-sql:
spark-sql
and the spark sql shell started up USE default
show tables;
--> i see my table in there, hive_tableX
SELECT * FROM hive_tableX LIMIT 1
and I see some successful results. then I turn on thriftserver
./sbin/start-thriftserver.sh
next, I turn on beeline so I can test the thriftserver connection
!connect jdbc:hive2://localhost:10000
(and enter username and password) use default;
show tables;
--> there's nothing there. So, where are my tables? is beeline or thrift pointing to a different warehouse or something?
Edit: I think my thriftserver isn't using the right warehouse directory, so I'm trying to start it with a config option:
Edit: starting it in the same physical directory as where the wherehouse was created seems to do the trick. Although, I don't know how to programmatically set the path to something else and start it elsewhere.
the solution to this particular problem was that I was starting thrift from a different directory than the spark-wherehouse
and metastore_db
were located.
Once I started it from the correct directory, it worked as expected and my tables were now available.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.