@InterfaceStability.Evolving public interface WriteSupport
DataSourceV2. Data sources can implement this interface to provide data writing ability and save the data to the data source.
|Modifier and Type||Method and Description|
Creates an optional
java.util.Optional<DataSourceV2Writer> createWriter(String jobId, StructType schema, SaveMode mode, DataSourceV2Options options)
DataSourceV2Writerto save the data to this data source. Data sources can return None if there is no writing needed to be done according to the save mode. If this method fails (by throwing an exception), the action would fail and no Spark job was submitted.
jobId- A unique string for the writing job. It's possible that there are many writing jobs running at the same time, and the returned
DataSourceV2Writercan use this job id to distinguish itself from other jobs.
schema- the schema of the data to be written.
mode- the save mode which determines what to do when the data are already in this data source, please refer to
SaveModefor more details.
options- the options for the returned data source writer, which is an immutable case-insensitive string-to-string map.