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:
-
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 (CTAS) SQL statements)
| CreatableRelationProvider | Description |
|---|---|
|
Data source provider for JDBC data source |
|
|
Data source provider for Kafka data source |
spark技术分享