Hive context is not working as expected

Hello Everyone,
I am trying to get the database from hive context but i am only getting default database while i have many databases present in hive.I am attaching the screenshot .Kindly guide me in this.Thanks

@anirvan_sen can you just type ‘sqlContext’ and post the result. Just want to see whether sqlContext object is of type HiveContext!

It is in hivecontext.But still not showing the tables

I guess you need to configure hive -site.xml file in spark/conf folder.

just follow these steps

check spark/conf folder and hive/conf folder
ls /usr/lib/spark/conf
ls /usr/lib/hive/conf

if you do not find hive-site.xml file in spark/conf folder which is present in hive/conf then create a soft link

sudo ln -s /usr/lib/hive/conf/hive-site.xml /usr/lib/spark/conf/hive-site.xml

1 Like

Worked like a charm.I totally forgot about the soft link.Thanks a lot