jayzhan211 commented on PR #24698:
URL: https://github.com/apache/datafusion/pull/24698#issuecomment-6580086078
@xavlee Yes, that makes sense. `UnionExec` turns each child partition into
its own output partition, so a tuple holds on the output whenever it holds on
every input, and `InterleaveExec` is right to drop it. It's a small change, so
could you add it to this PR? This rule passes the existing union tests locally.
It keeps a tuple from either side when both sides satisfy it, so an ordering on
one side counts too:
```diff
+ // Each union output partition is one input partition, so a grouping
holds
+ // when every input satisfies it, explicitly or through an ordering.
+ let mut groupings = vec![];
+ for grouping in lhs.geq_class().iter().chain(rhs.geq_class().iter()) {
+ if lhs.grouping_satisfy(grouping.iter().cloned())?
+ && rhs.grouping_satisfy(grouping.iter().cloned())?
+ {
+ groupings.push(grouping.clone());
+ }
+ }
+
let mut eq_properties = EquivalenceProperties::new(lhs.schema);
eq_properties.add_constants(constants)?;
eq_properties.add_orderings(orderings);
+ eq_properties.add_groupings(groupings);
```
Please add tests for these cases: grouped on `[a, b]` with grouped keeps it,
grouped with an unannotated input drops it, and sorted on `[a, b]` with grouped
keeps it.
--
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]