How to query hive tables using Spark SQL from the terminal



How do I query the existing Hive tables on Spark SQL from the terminal directly.
Also there are multiple databases, so I need to work with different tables in different databases.

NOTE: I do not have access the file location, just the HIVE tables.


Ran spark with hive Context and select * from dbname.tablename.


If you want to do it programmatically , click on the below link :smile: