简体   繁体   中英

How to save temptable to Hive metastore (and analyze it in Hive)?

I use Spark 1.3.1.

How to store/save a DataFrame data to a Hive metastore?

In Hive If I run show tables the DataFrame does not appear as a table in Hive databases. I have copied hive-site.xml to $SPARK_HOME/conf , but it didn't help (and the dataframe does not appear in Hive metastore either).

I am following this document , using spark 1.4 version.

dataframe.registerTempTable("people")

How to analyze the spark table in Hive?

You can use insertInto method to save dataframe in hive.

Example:

dataframe.insertInto("table_name", false);
//2nd arg is to specify if table should be overridden

Got the solution. I am using spark 1.3.1, so that it's not supporting all. Now using spark 1.5.1 that problem resolved. I have noticed data-frames fully working after 1.40. Many commands are deprecated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM