I am using pyspark to access hive inside my HDinsight cluster. When i go and query hive it shows me all the databases but when i query from spark it just shows default database.
I believe it just go and query spark catalog by default.
The workaround i found was i should use Hive warehouse connector to connect to hive from spark.
Is there any other way to do it?
Code
spark = SparkSession \
.builder \
.appName("Python Spark SQL Hive integration example") \
.config("hive.metastore.uris", "thrift://hn0-mytestua.abc.dxbx.internal.cloudapp.net:9083") \
.config("spark.sql.warehouse.dir", '/hive/warehouse/external') \
.enableHiveSupport() \
.getOrCreate()
spark.sql("show databases").show()