jayzhan211 commented on code in PR #27191:
URL: https://github.com/apache/datafusion/pull/27191#discussion_r4501885535
##########
datafusion/physical-expr/src/equivalence/properties/mod.rs:
##########
@@ -392,12 +392,27 @@ impl EquivalenceProperties {
.filter_map(|o| self.normalize_sort_exprs(o))
.collect();
if !normal_orderings.is_empty() {
+ // What the new orderings imply through known equalities.
`add_constants`
+ // and `add_equal_conditions` discover this too, and whether an
ordering
+ // is satisfied must not depend on which of them ran last. If it
cannot
+ // be derived, nothing is implied.
+ let implied: Vec<_> = normal_orderings
+ .iter()
+ .filter_map(|ordering| {
+ self.implied_ordering(&ordering[0], ordering[1..].iter())
+ .ok()
+ .flatten()
Review Comment:
`add_ordering` and `add_orderings` now return `Result`, so this error
reaches the caller. `SortPreservingMergeExec::new` and
`RepartitionExec::with_preserve_order` can't return one without changing their
signatures (57 and 20 call sites), so they panic on it, as `SortExec::new`
already does. In practice it takes an expression that doesn't match the schema.
@alamb let me know if you'd rather change those two signatures as well.
--
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]