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 2020/10/02 00:44:00 UTC

[GitHub] [spark] rdblue commented on a change in pull request #29066: [WIP][SPARK-23889] DataSourceV2: required sorting and clustering for writes

rdblue commented on a change in pull request #29066:
URL: https://github.com/apache/spark/pull/29066#discussion_r498576002



##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/write/WriteBuilder.java
##########
@@ -23,17 +23,34 @@
 import org.apache.spark.sql.connector.write.streaming.StreamingWrite;
 
 /**
- * An interface for building the {@link BatchWrite}. Implementations can mix in some interfaces to
+ * An interface for building the {@link Write}. Implementations can mix in some interfaces to
  * support different ways to write data to data sources.
  *
- * Unless modified by a mixin interface, the {@link BatchWrite} configured by this builder is to
+ * Unless modified by a mixin interface, the {@link Write} configured by this builder is to
  * append data without affecting existing data.
  *
  * @since 3.0.0
  */
 @Evolving
 public interface WriteBuilder {
 
+  /**
+   * Returns a logical {@link Write} shared between batch and streaming.
+   */
+  default Write build() {

Review comment:
       The `buildForBatch` method (and stream equivalent) are already released, so this generic `Write` implementation makes the new structure, `build` + `toBatch`, work for existing sources. It also allows sources to implement the version that they choose. So if none of the features that require the `Write` are used, I guess they could avoid a mostly-boilerplate class.




----------------------------------------------------------------
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:
users@infra.apache.org



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