package org.apache.spark.sql.sources
trait SchemaRelationProvider {
def createRelation(
sqlContext: SQLContext,
parameters: Map[String, String],
schema: StructType): BaseRelation
}
SchemaRelationProvider — Data Sources With Mandatory User-Defined Schema
SchemaRelationProvider
is a contract for data source providers that require a user-defined schema.
SchemaRelationProvider
is used exclusively when:
-
DataSource
is requested for a BaseRelation for a data source
Note
|
BaseRelation models a collection of tuples from an external data source with a schema. |
Tip
|
Use RelationProvider for data source providers with schema inference. |
Tip
|
Use both SchemaRelationProvider and RelationProvider if a data source can support both schema inference and user-defined schemas.
|
SchemaRelationProvider Contract
Method | Description |
---|---|
Creates a BaseRelation for the |