snowflake.snowpark.DataFrameWriter¶
- class snowflake.snowpark.DataFrameWriter(dataframe: DataFrame)[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/dataframe_writer.py#L42-L488)¶
Bases:
objectProvides methods for writing data from a
DataFrameto supported output destinations.To use this object:
Create an instance of a
DataFrameWriterby accessing theDataFrame.writeproperty.(Optional) Specify the save mode by calling
mode(), which returns the sameDataFrameWriterthat is configured to save data using the specified mode. The default mode is “errorifexists”.Call
save_as_table()orcopy_into_location()to save the data to the specified destination.
Methods
Executes a COPY INTO <location> to unload data from a
DataFrameinto one or more files in a stage or external stage.csv(location, *[, partition_by, ...])Executes internally a COPY INTO <location> to unload data from a
DataFrameinto one or more CSV files in a stage or external stage.json(location, *[, partition_by, ...])Executes internally a COPY INTO <location> to unload data from a
DataFrameinto a JSON file in a stage or external stage.mode(save_mode)Set the save mode of this
DataFrameWriter.parquet(location, *[, partition_by, ...])Executes internally a COPY INTO <location> to unload data from a
DataFrameinto a PARQUET file in a stage or external stage.saveAsTable(table_name, *[, mode, ...])Writes the data to the specified table in a Snowflake database.
Writes the data to the specified table in a Snowflake database.