gabotechs commented on code in PR #23184:
URL: https://github.com/apache/datafusion/pull/23184#discussion_r3492837680


##########
datafusion/physical-expr/src/partitioning.rs:
##########
@@ -596,17 +642,39 @@ pub enum Distribution {
     /// Requires children to be distributed in such a way that the same
     /// values of the keys end up in the same partition
     HashPartitioned(Vec<Arc<dyn PhysicalExpr>>),
+    /// Requires rows with equal values for the given keys to be colocated in
+    /// the same partition, without requiring a specific partitioning 
algorithm.
+    ///
+    /// Unlike [`Self::HashPartitioned`], this can be satisfied by non-hash
+    /// partitioning such as range partitioning. A partitioning on a subset of
+    /// these keys can also satisfy this requirement because rows equal on all
+    /// required keys are also equal on any subset.
+    ///
+    /// For multi-input operators, satisfaction alone is not enough: each input
+    /// may satisfy its own key requirement while using incompatible partition
+    /// boundaries. Use [`Partitioning::co_partitioned_with`] before pairing
+    /// partitions by index.
+    KeyPartitioned(Vec<Arc<dyn PhysicalExpr>>),
 }

Review Comment:
   Also, just keeping the `HashPartitioned` name without introducing 
`KeyPartitioned` and documenting the potential weirdness can be a good option 
that does not imply breaking API changes



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

Reply via email to