I am trying to access a hive table specifying database qualifier using spark sql. I am using sparksession as it is spark 2.0 or above. For example, I am trying to add a partition to an existing table. The query is
sparksession.sql("ALTER TABLE $databasename.$tablename ADD PARTITION (...) LOCATION ...")
It doesn't throw any error but not even creating any partition. Is it the case that I can't specify databaseName in spark sql?