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


##########
datafusion/physical-expr/src/partitioning.rs:
##########
@@ -442,6 +521,42 @@ impl Partitioning {
         }
     }
 
+    /// Returns true when `self` and `other` describe compatible partition 
maps.
+    ///
+    /// Compatible partition maps can be used for partition-local behavior: if
+    /// this returns true, partition `i` from both partitionings can be treated
+    /// as covering the same partition domain. This is stricter than
+    /// [`Self::satisfaction`], which only answers whether this partitioning 
can
+    /// satisfy a required distribution.
+    pub fn compatible_with(

Review Comment:
   It's a bit hard to review if this is the appropriate shape if it's still not 
used anywhere.
   
   It looks correct, but I'd be curious to see how this is used in practice, as 
otherwise it's very hard to give any feedback on this API.
   
   Do you have maybe any stacked follow up in which this is used?



##########
datafusion/physical-expr/src/partitioning.rs:
##########
@@ -498,36 +613,23 @@ impl Partitioning {
                         return PartitioningSatisfaction::NotSatisfied;
                     }
 
-                    // Fast path: exact match
-                    if physical_exprs_equal(required_exprs, partition_exprs) {
+                    if equivalent_exprs(required_exprs, partition_exprs, 
eq_properties) {

Review Comment:
   Ah no, reading the code below `eq_properties` was also used before, :+1: all 
good.



##########
datafusion/physical-expr/src/partitioning.rs:
##########
@@ -498,36 +613,23 @@ impl Partitioning {
                         return PartitioningSatisfaction::NotSatisfied;
                     }
 
-                    // Fast path: exact match
-                    if physical_exprs_equal(required_exprs, partition_exprs) {
+                    if equivalent_exprs(required_exprs, partition_exprs, 
eq_properties) {

Review Comment:
   Isn't this changing the previous behavior. Before, `eq_properties` did not 
have a say on whether these two are equal or not, but now it does.



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