ozankabak commented on code in PR #5111:
URL: https://github.com/apache/arrow-datafusion/pull/5111#discussion_r1091081500


##########
datafusion/core/src/physical_plan/union.rs:
##########
@@ -240,14 +239,20 @@ impl ExecutionPlan for UnionExec {
         // which is the "meet" of all input orderings. In this example, this
         // function will return vec![false, true, true], indicating that we
         // preserve the orderings for the 2nd and the 3rd children.
-        self.inputs()
-            .iter()
-            .map(|child| {
-                ordering_satisfy(self.output_ordering(), 
child.output_ordering(), || {
-                    child.equivalence_properties()
+        if let Some(output_ordering) = self.output_ordering() {
+            self.inputs()
+                .iter()
+                .map(|child| {
+                    if let Some(child_ordering) = child.output_ordering() {

Review Comment:
   The call `self.output_ordering()` in turn calls `get_meet_of_orderings` and 
gets the common longest prefix. We then check whether any of the inputs are 
equal to that prefix. We are checking for strict equality instead of an 
equivalence-aware check following @mingmwang's suggestion.



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

Reply via email to