from spark or pyspark shell use the below commands to access hive database objects.
spark.sql("show databases;")
spark.sql("select * from databasename.tablename;")
or
spark.read.table("databasename.tablename")
You can give any query inside spark.sql which will give you results.