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 2021/01/28 00:22:56 UTC

[GitHub] [spark] rdblue commented on a change in pull request #31355: [SPARK-34255][SQL] Support partitioning with static number on required distribution and ordering on V2 write

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



##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/distributions/ClusteredDistribution.java
##########
@@ -32,4 +32,13 @@
    * Returns clustering expressions.
    */
   Expression[] clustering();
+
+  /**
+   * Returns the number of partitions required by this write.
+   * <p>
+   * Implementations may want to override this if it requires the specific number of partitions.
+   *
+   * @return the required number of partitions, non-positive values mean no requirement.
+   */
+  default int requiredNumPartitions() { return 0; }

Review comment:
       Why not also add a parallelism requirement to `UnspecifiedDistribution`? That could insert a coalesce.




----------------------------------------------------------------
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