Phoenix500526 commented on PR #27117: URL: https://github.com/apache/datafusion/pull/27117#issuecomment-6825803499
> [@Phoenix500526](https://github.com/Phoenix500526) thanks for the fix! `decorrelate.rs` around line 891 still has its own copy of this rule (`has_empty_set`), and this is the fourth fix of this fact ([#22039](https://github.com/apache/datafusion/pull/22039), [#25781](https://github.com/apache/datafusion/pull/25781), [#22926](https://github.com/apache/datafusion/pull/22926)). Could it call the new helper too, so every logical check uses one rule? At that point `grouping_sets` is non-empty, so `group_expr` is always `[GroupingSet]` and the result is the same. Locally, clippy and the optimizer and subquery tests pass with this change. > > -use crate::utils::replace_qualified_name; > +use crate::utils::{aggregate_emits_on_empty_input, replace_qualified_name}; > @@ > - let has_empty_set = grouping_sets.iter().any(|grouping_set| match grouping_set { > - GroupingSet::Rollup(_) | GroupingSet::Cube(_) => true, > - GroupingSet::GroupingSets(sets) => sets.iter().any(|set| set.is_empty()), > - }); > + let has_empty_set = aggregate_emits_on_empty_input(group_expr); Thanks @jayzhan211 Good catch. I've used `aggregate_emits_on_empty_input` instead -- 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]
