class SimpleWritableDataSource extends DataSourceV2 with ReadSupport with WriteSupport {
override def createReader()
override def createWriter()
}
构造 DataSourceReader
class Reader(path: String, conf: Configuration) extends DataSourceReader
{
/**
* Returns the actual schema of this data source reader, which may be different from the physical
* schema of the underlying storage, as column pruning or other optimizations may happen.
*
override def readSchema()
/**
* Returns a list of reader factories. Each factory is responsible for creating a data reader to
* output data for one RDD partition. That means the number of factories returned he