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:

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

package org.apache.spark.sql.sources

trait SchemaRelationProvider {
  def createRelation(
    sqlContext: SQLContext,
    parameters: Map[String, String],
    schema: StructType): BaseRelation
}
Table 1. SchemaRelationProvider Contract
Method Description

createRelation

Creates a BaseRelation for the parameters and user-defined schema

results matching ""

    No results matching ""