cloud-fan commented on a change in pull request #35657:
URL: https://github.com/apache/spark/pull/35657#discussion_r839244934
##########
File path:
sql/catalyst/src/main/java/org/apache/spark/sql/connector/read/partitioning/KeyGroupedPartitioning.java
##########
@@ -18,27 +18,37 @@
package org.apache.spark.sql.connector.read.partitioning;
import org.apache.spark.annotation.Evolving;
-import org.apache.spark.sql.connector.read.PartitionReader;
+import org.apache.spark.sql.connector.expressions.Expression;
/**
- * An interface to represent data distribution requirement, which specifies
how the records should
- * be distributed among the data partitions (one {@link PartitionReader}
outputs data for one
- * partition).
+ * Represents a partitioning where rows are split across partitions based on
the expressions
+ * returned by {@link KeyGroupedPartitioning#clustering}.
* <p>
- * Note that this interface has nothing to do with the data ordering inside one
- * partition(the output records of a single {@link PartitionReader}).
- * <p>
- * The instance of this interface is created and provided by Spark, then
consumed by
- * {@link Partitioning#satisfy(Distribution)}. This means data source
developers don't need to
- * implement this interface, but need to catch as more concrete
implementations of this interface
- * as possible in {@link Partitioning#satisfy(Distribution)}.
- * <p>
- * Concrete implementations until now:
- * <ul>
- * <li>{@link ClusteredDistribution}</li>
- * </ul>
+ * Data source implementations should make sure that all rows where
+ * {@link KeyGroupedPartitioning#clustering} evaluate to the same value should
be in the same
+ * partition.
Review comment:
I think we need to spend more time making this doc clear.
`KeyGroupedPartitioning` does mean that, logiclally each output partition
should only contains rows with the same value, and different partitions have
different values. But physically the data source can put rows with the same
value in different partitions, and Spark will group them later.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]