Accessing db.table from cluster setup using spark sql

Hi All

while we have given a database and table name in the cluster setup, should i write db.tablename in sparksql as below?

sql(“select * from db.tablename”)

This db.tablename can be hive or mysql or any other db setup in the cluster. Can above statement will be applicable for all above db setup in cluster?

please help.


Prepare for certifications on our state of the art labs which have Hadoop, Spark, Kafka, Hive and other Big Data technologies

  • Click here for signing up for our state of the art 13 node Hadoop and Spark Cluster

Hi @Jyutika_Kathe,

In case of hive you have to spacify table name along with db like- db_name.table_name

i think in case of other databases we need to follow with the same approach.