void abort(WriterCommitMessage[] messages)
DataSourceWriter Contract
DataSourceWriter is the abstraction of data source writers in Data Source API V2 that can abort or commit a writing Spark job, create a DataWriterFactory to be shared among writing Spark tasks and optionally handle a commit message and use a CommitCoordinator for writing Spark tasks.
|
Note
|
The terms Spark job and Spark task are really about the low-level Spark jobs and tasks (that you can monitor using web UI for example). |
DataSourceWriter is used to create a logical WriteToDataSourceV2 and physical WriteToDataSourceV2Exec operators.
DataSourceWriter is created when:
-
DataSourceV2Relationlogical operator is requested to create one -
WriteSupportdata source is requested to create one
| Method | Description |
|---|---|
|
Aborts a writing Spark job Used exclusively when |
|
Commits a writing Spark job Used exclusively when |
|
Creates a DataWriterFactory Used when:
|
|
Handles Defaults to do nothing Used exclusively when |
|
Controls whether to use a Spark Core Default: Used exclusively when |
| DataSourceWriter | Description |
|---|---|
|
Used in Spark Structured Streaming only for Micro-Batch Stream Processing |
|