CreatableRelationProvider Contract — Data Sources That Write Rows Per Save Mode
CreatableRelationProvider
is the contract for data source providers that want to support writing the rows of a structured query (a DataFrame) per save mode.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
package org.apache.spark.sql.sources trait CreatableRelationProvider { def createRelation( sqlContext: SQLContext, mode: SaveMode, parameters: Map[String, String], data: DataFrame): BaseRelation } |
Method | Description |
---|---|
|
The save mode specifies what happens when the destination already exists and can be one of the following: |
CreatableRelationProvider
is used when:
-
DataSource
is requested to write the result of a structured query to data source per save mode (afterDataFrameWriter
is requested to save) -
DataSource
is requested to write the result of a structured query to data source per save mode followed by reading rows back (afterDataFrameWriter
is requested to save to a non-Hive table or for Create Table As Select (CTAS) SQL statements)
CreatableRelationProvider | Description |
---|---|
Data source provider for JDBC data source |
|
Data source provider for Kafka data source |