3
votes

From spark using:

DataFrame.write().mode(SaveMode.Ignore).format("orc").saveAsTable("myTableName")

Table is getting saved I can see using below command's hadoop fs -ls /apps/hive/warehouse\test.db' where test is my database name

drwxr-xr-x - psudhir hdfs 0 2016-01-04 05:02 /apps/hive/warehouse/test.db/myTableName

but when I trying to check tables in Hive I cannot view them either with command SHOW TABLES from hiveContext.

3
Is this a internal table?/or U have mentioned as external table some wheeAman
I didn't get you, " myTableName " is the new table name , sorry I was using SaveMode.Ignore and SaveMode.Errorifxists as creating new tablesudhir
what is the content of your hive-conf file you have put under the Spark conf dir? Can you see from Spark Hive tables?mgaido

3 Answers

2
votes
sudo cp /etc/hive/conf.dist/hive-site.xml /etc/spark/conf/

This worked for me in a Cloudera quick start Virtual Box.

1
votes

You have to copy the hive-site.xml file (mine is located at /etc/hive/conf.dist/hive-site.xml) to Spark conf folder (mine is located at /etc/spark/conf/)

sudo cp /etc/hive/conf.dist/hive-site.xml /etc/spark/conf/

Restart Spark and it should work.

-3
votes

I think you need to run INVALIDATE METADATA; in the hive console to refresh the databases and view your new table.