I am running spark sql on hive. I need to add auto.purge table properties while creating new hive table. I tried below code to add options while calling saveAsTable method :
inputDF.write.option("auto.purge" -> "true").saveAsTable(hiveTableName)
Above line of code added a property under WITH SERDEPROPERTIES of table. I need to add this property under TBLPROPERTIES section of hive DDL.
.registerTempTable("tmp")
, then an explicit "CREATE TABLE target" SQL command, then an explicit "INSERT INTO TABLE target SELECT * FROM tmp"? - Samson ScharfrichterSqlContext.sql("create db.table_name as select * from df_temp_tbl")
- Sandeep Singh