@InterfaceStability.Evolving public interface ReadSupport extends DataSourceV2
DataSourceV2
. Data sources can implement this interface to
provide data reading ability and scan the data from the data source.Modifier and Type | Method and Description |
---|---|
DataSourceReader |
createReader(DataSourceOptions options)
Creates a
DataSourceReader to scan the data from this data source. |
default DataSourceReader |
createReader(StructType schema,
DataSourceOptions options)
Creates a
DataSourceReader to scan the data from this data source. |
default DataSourceReader createReader(StructType schema, DataSourceOptions options)
DataSourceReader
to scan the data from this data source.
If this method fails (by throwing an exception), the action will fail and no Spark job will be
submitted.schema
- the user specified schema.options
- the options for the returned data source reader, which is an immutable
case-insensitive string-to-string map.
By default this method throws UnsupportedOperationException
, implementations should
override this method to handle user specified schema.DataSourceReader createReader(DataSourceOptions options)
DataSourceReader
to scan the data from this data source.
If this method fails (by throwing an exception), the action will fail and no Spark job will be
submitted.options
- the options for the returned data source reader, which is an immutable
case-insensitive string-to-string map.