package org.apache.spark.sql.sources
trait CreatableRelationProvider {
def createRelation(
sqlContext: SQLContext,
mode: SaveMode,
parameters: Map[String, String],
data: DataFrame): BaseRelation
}
CreatableRelationProvider — Data Sources That Save Rows Per Save Mode
CreatableRelationProvider is a contract for data source providers that save the result of a structured query per save mode and return the schema.
CreatableRelationProvider is used when:
-
DataSourceis requested to write the result of a structured query to data source per save mode (afterDataFrameWriteris requested to save) -
DataSourceis requested to write the result of a structured query to data source per save mode followed by reading rows back (afterDataFrameWriteris requested to save to a non-Hive table or for Create Table As Select SQL statements)
| Name | Description |
|---|---|
CreatableRelationProvider Contract
| Method | Description |
|---|---|
Saves the result of a structured query to a target relation per save mode and parameters. Creates a BaseRelation to describe the scheme. The save mode specifies what happens when the destination already exists:
|