What's the right way to insert DF to Hive Internal table in Append Mode. It seems we can directly write the DF to Hive using "saveAsTable" method OR store the DF to temp table then use the query.
df.write().mode("append").saveAsTable("tableName")
OR
df.registerTempTable("temptable")
sqlContext.sql("CREATE TABLE IF NOT EXISTS mytable as select * from temptable")
Will the second approach append the records or overwrite it?
Is there any other way to effectively write the DF to Hive Internal table?