I use Spark 2.0.2.
While learning the concept of writing a dataset to a Hive table, I understood that we do it in two ways:
- using sparkSession.sql("your sql query")
- dataframe.write.mode(SaveMode."type of mode").insertInto("tableName")
Could anyone tell me what is the preferred way of loading a Hive table using Spark ?