CreatableRelationProvider Contract — Data Sources That Write Rows Per Save Mode

package org.apache.spark.sql.sources

trait CreatableRelationProvider {
  def createRelation(
    sqlContext: SQLContext,
    mode: SaveMode,
    parameters: Map[String, String],
    data: DataFrame): BaseRelation
Table 1. CreatableRelationProvider Contract
Method Description


Saving the rows of a structured query (a DataFrame) to an external data source

createRelation saves the rows of a structured query (a DataFrame) to a target relation per save mode and parameters. In the end, createRelation creates a BaseRelation to represent the relation created.

The save mode specifies what happens when the destination already exists and can be one of the following:

  • Append

  • ErrorIfExists

  • Ignore

  • Overwrite

CreatableRelationProvider is used when:

Table 2. CreatableRelationProviders
CreatableRelationProvider Description


Data source provider for JDBC data source


Data source provider for Kafka data source

results matching ""

    No results matching ""