public class DataFrameWriter extends Object
To use this object:
1. Access an instance of a DataFrameWriter by calling the DataFrame.write method. 1.
Specify the save mode to use (overwrite or append) by calling the mode() method. This
method returns a DataFrameWriter that is configured to save data using the specified mode. The
default SaveMode is SaveMode.Append. 1. Call a `saveAs*` method to save the data
to the specified destination.
| Modifier and Type | Method and Description |
|---|---|
DataFrameWriterAsyncActor |
async()
Returns a DataFrameWriterAsyncActor object that can be used to execute DataFrameWriter actions
asynchronously.
|
DataFrameWriter |
mode(SaveMode saveMode)
Returns a new DataFrameWriter with the specified save mode configuration.
|
DataFrameWriter |
mode(String saveMode)
Returns a new DataFrameWriter with the specified save mode configuration.
|
DataFrameWriter |
option(String key,
Object value)
Sets the specified option in the DataFrameWriter.
|
void |
saveAsTable(String tableName)
Writes the data to the specified table in a Snowflake database.
|
void |
saveAsTable(String[] multipartIdentifier)
Writes the data to the specified table in a Snowflake database.
|
public DataFrameWriter option(String key, Object value)
Use this method to configure options:
key - Name of the option.value - Value of the option.DataFrameWriterpublic void saveAsTable(String tableName)
tableName can be a
fully-qualified object identifier.
For example:
df.write().saveAsTable("db1.public_schema.table1");
tableName - Name of the table where the data should be saved.public void saveAsTable(String[] multipartIdentifier)
For example:
df.write().saveAsTable(new String[]{"db_name", "schema_name", "table_name"})
multipartIdentifier - A sequence of strings that specify the database name, schema name,
and table name.public DataFrameWriter mode(String saveMode)
saveMode - One of the following strings: `"APPEND"`, `"OVERWRITE"`, `"ERRORIFEXISTS"`, or
`"IGNORE"`public DataFrameWriter mode(SaveMode saveMode)
saveMode - One of the following save modes: SaveMode.Append, SaveMode.Overwrite, SaveMode.ErrorIfExists, SaveMode.Ignorepublic DataFrameWriterAsyncActor async()
© 2022 Snowflake Inc. All Rights Reserved