class DataFrameWriter extends AnyRef
Provides methods for writing data from a DataFrame to supported output destinations.
To use this object:
- Access an instance of a DataFrameWriter by calling the DataFrame.write method.
- 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.
- Call a
saveAs*method to save the data to the specified destination.
For example:
df.write.mode("overwrite").saveAsTable("T")
- Since
0.1.0
- Alphabetic
- By Inheritance
- DataFrameWriter
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
async: DataFrameWriterAsyncActor
Returns a DataFrameWriterAsyncActor object that can be used to execute DataFrameWriter actions asynchronously.
Returns a DataFrameWriterAsyncActor object that can be used to execute DataFrameWriter actions asynchronously.
Example:
val asyncJob = df.write.mode(SaveMode.Overwrite).async.saveAsTable(tableName) // At this point, the thread is not blocked. You can perform additional work before // calling asyncJob.getResult() to retrieve the results of the action. // NOTE: getResult() is a blocking call. asyncJob.getResult()
- returns
A DataFrameWriterAsyncActor object
- Since
0.11.0
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
mode(saveMode: SaveMode): DataFrameWriter
Returns a new DataFrameWriter with the specified save mode configuration.
Returns a new DataFrameWriter with the specified save mode configuration.
- saveMode
One of the following save modes: SaveMode.Append, SaveMode.Overwrite, SaveMode.ErrorIfExists, SaveMode.Ignore
- Since
0.1.0
-
def
mode(saveMode: String): DataFrameWriter
Returns a new DataFrameWriter with the specified save mode configuration.
Returns a new DataFrameWriter with the specified save mode configuration.
- saveMode
One of the following strings:
"APPEND","OVERWRITE","ERRORIFEXISTS", or"IGNORE"
- Since
0.1.0
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
option(key: String, value: Any): DataFrameWriter
Sets the specified option in the DataFrameWriter.
Sets the specified option in the DataFrameWriter.
Use this method to configure options: - columnOrder: save data into a table with table's column name order if saveMode is Append and target table exists.
- key
Name of the option.
- value
Value of the option.
- returns
- Since
1.4.0
-
def
saveAsTable(multipartIdentifier: List[String]): Unit
Writes the data to the specified table in a Snowflake database.
Writes the data to the specified table in a Snowflake database.
For example:
val list = new java.util.ArrayList[String](3) list.add(db) list.add(sc) list.add(tableName) df.write.saveAsTable(list)
- multipartIdentifier
A list of strings that specify the database name, schema name, and table name.
- Since
0.5.0
-
def
saveAsTable(multipartIdentifier: Seq[String]): Unit
Writes the data to the specified table in a Snowflake database.
Writes the data to the specified table in a Snowflake database.
For example:
df.write.saveAsTable(Seq("db_name", "schema_name", "table_name"))
- multipartIdentifier
A sequence of strings that specify the database name, schema name, and table name (e.g.
Seq("database_name", "schema_name", "table_name")).
- Since
0.5.0
-
def
saveAsTable(tableName: String): Unit
Writes the data to the specified table in a Snowflake database.
Writes the data to the specified table in a Snowflake database.
tableNamecan 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.
- Since
0.1.0
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()