DataFrameWriter.
saveAsTable
Saves the content of the DataFrame as the specified table.
DataFrame
In the case the table already exists, behavior of this function depends on the save mode, specified by the mode function (default to throwing an exception). When mode is Overwrite, the schema of the DataFrame does not need to be the same as that of the existing table.
append: Append contents of this DataFrame to existing data.
overwrite: Overwrite existing data.
error or errorifexists: Throw an exception if data already exists.
ignore: Silently ignore this operation if data already exists.
New in version 1.4.0.
the table name
the format used to save
one of append, overwrite, error, errorifexists, ignore (default: error)
names of partitioning columns
all other string options