You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/02/18 11:04:22 UTC

[GitHub] gengliangwang opened a new pull request #23824: [SPARK-26913][SQL] New data source V2 API: SupportsDirectWrite

gengliangwang opened a new pull request #23824: [SPARK-26913][SQL] New data source V2 API: SupportsDirectWrite
URL: https://github.com/apache/spark/pull/23824
 
 
   ## What changes were proposed in this pull request?
   
   Spark supports writing to file data sources without getting the table schema and validation with the schema.
   For example, 
   ```
   spark.range(10).write.orc(path)
   val newDF = spark.range(20).map(id => (id.toDouble, id.toString)).toDF("double", "string")
   newDF.write.mode("overwrite").orc(path)
   ```
   1. There is no actions to get/infer the schema from the table/path
   2. The schema of `newDF` can be different with the original table schema.
   
   However, from https://github.com/apache/spark/pull/23606/files#r255319992 we can see that **the feature above is still missing in data source V2**. Currently, data source V2 always validates the output query with the table schema. Even after the catalog support of DS V2 is implemented, I think it is hard to support both behaviors with the current API/framework.
   
   This PR proposes to create a new mix-in interface `SupportsDirectWrite`. With the interface, Spark will write to the table location directly without schema inference and validation on `DataFrameWriter.save()`.
   
   The PR also reeanbles Orc data source V2.
   
   ## How was this patch tested?
   
   Unit test
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org