This generally happens when Hive service is not enabled for the Spark2. Please ensure that you've selected the Hive Service dependency on the Spark2:
- login to CM WebUI
- go to Spark2 service - click on the configuration tab - in the search box type in hive - if it's set to none, select the hive service and redeploy the client and the stale configuration.
The default database is 'default'. Are your tables (a1,a2,a3) a part of 'default' database in hive or are they created on another database? If you do a "show databases" from spark sql does it lists all the DB's or just default?