gabotechs commented on code in PR #23184:
URL: https://github.com/apache/datafusion/pull/23184#discussion_r3492179416
##########
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:
For doing this incrementally, I imagine that if we keep both
`HashPartitioned` and `KeyPartitioned` alive while introducing the changes in
this PRs and the followings, you are going to be paying a high price in terms
of code for maintaining compatibility with both for something that is meant to
disappear right afterwards.
A cheaper option would be to rename `HashPartitioned` to `KeyPartitioned`
first, and then you would not need to pay the price of maintaining
compatibility with both.
I'd would not be surprised if you find out that renaming `HashPartitioned`
to `KeyPartitioned` is completely free without caveats.
--
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]