Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Create a write configuration builder for v2 sources.
Syntax
writeTo(table: str)
Parameters
| Parameter | Type | Description |
|---|---|---|
table |
str | Target table name to write to. |
Returns
DataFrameWriterV2: DataFrameWriterV2 to use further to specify how to save the data.
Notes
This builder is used to configure and execute write operations. For example, to append or create or replace existing tables.
Examples
df = spark.createDataFrame(
[(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"])
df.writeTo("catalog.db.table").append()
df.writeTo(
"catalog.db.table"
).partitionedBy("col").createOrReplace()