cloud-fan commented on a change in pull request #24233: [SPARK-26356][SQL] 
remove SaveMode from data source v2
URL: https://github.com/apache/spark/pull/24233#discussion_r271112935
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala
 ##########
 @@ -267,6 +266,23 @@ final class DataFrameWriter[T] private[sql](ds: 
Dataset[T]) {
 
       import 
org.apache.spark.sql.execution.datasources.v2.DataSourceV2Implicits._
       provider.getTable(dsOptions) match {
+        // TODO: for backward compatibility reasons, the builtin file source 
needs to support all
+        // the save modes, which violates the semantic of `TableProvider`. 
Here we special-case
+        // file source and pass the save mode to file source directly. This 
hack can be removed
+        // after we figure out a general interface for path-based data sources.
+        case table: FileTable =>
 
 Review comment:
   Because we want to migrate file source to v2, to validate the API of 
`Table`, `ScanBuilder`, `WriteBuilder`, etc.
   
   This hack is just to work around the issue that we do not have a proper 
entry API for path-based data source, which I believe we will have later on.
   
   I think this is not a bad idea. We can unblock the file source migration, 
and we can keep the DS v2 clean (`FileTable` is an internal class). Besides 
that this hack will be removed once we have path-based API in DS v2.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to