@InterfaceStability.Evolving public interface ReadSupportWithSchema extends DataSourceV2
DataSourceV2. Data sources can implement this interface to provide data reading ability and scan the data from the data source. This is a variant of
ReadSupportthat accepts user-specified schema when reading data. A data source can implement both
ReadSupportWithSchemaif it supports both schema inference and user-specified schema.
DataSourceReader createReader(StructType schema, DataSourceOptions options)
DataSourceReaderto scan the data from this data source. If this method fails (by throwing an exception), the action would fail and no Spark job was submitted.
schema- the full schema of this data source reader. Full schema usually maps to the physical schema of the underlying storage of this data source reader, e.g. CSV files, JSON files, etc, while this reader may not read data with full schema, as column pruning or other optimizations may happen.
options- the options for the returned data source reader, which is an immutable case-insensitive string-to-string map.