Preserve grouping ID during aggregate CSE - #24144
Conversation
| #[test] | ||
| fn common_aggregate_grouping_set_preserves_internal_id() -> Result<()> { |
There was a problem hiding this comment.
Is there a chance we can reproduce this with a SLT?
There was a problem hiding this comment.
I poked around at doing this but I couldn't see an easy way to do it.
There was a problem hiding this comment.
Same, tried a bunch of ways.
neilconway
left a comment
There was a problem hiding this comment.
lgtm! Clean fix with a nicely scoped unit test.
There's a few places where we construct the grouping ID column via Expr::Column(Column::from_name(Aggregate::INTERNAL_GROUPING_ID)), which maybe would benefit from centralizing into a helper, but I think it's marginal.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24144 +/- ##
==========================================
- Coverage 81.05% 81.05% -0.01%
==========================================
Files 1106 1106
Lines 380556 380582 +26
Branches 380556 380582 +26
==========================================
+ Hits 308477 308492 +15
- Misses 53861 53866 +5
- Partials 18218 18224 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
@neilconway I can follow up with a new issue and a new PR, I think it would definitely help a bit. |
Sure, that would be great! Feel free to at-me on it. |
…gregate-cse-wnmpwslywnzn
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes apache#24143. ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. Please explain the problem you are trying to solve in terms of the user-visible behavior, rather than the implementation. For example, "The code in `foo.rs` doesn't handle nulls" is a symptom of the implementation. "COUNT(DISTINCT) returns wrong results when the column contains nulls" is the user-visible problem. --> See apache#24143. ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here, but it is sometimes worth providing a summary of the individual changes in this PR. --> - Preserve `__grouping_id` in CSE recovery projections for grouping-set aggregates. - Add regression coverage. ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> Yes. ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please add the `api change` label. --> No. Co-authored-by: Gabriel <45515538+gabotechs@users.noreply.github.com> (cherry picked from commit e64e3f7)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes apache#24143. ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. Please explain the problem you are trying to solve in terms of the user-visible behavior, rather than the implementation. For example, "The code in `foo.rs` doesn't handle nulls" is a symptom of the implementation. "COUNT(DISTINCT) returns wrong results when the column contains nulls" is the user-visible problem. --> See apache#24143. ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here, but it is sometimes worth providing a summary of the individual changes in this PR. --> - Preserve `__grouping_id` in CSE recovery projections for grouping-set aggregates. - Add regression coverage. ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> Yes. ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please add the `api change` label. --> No. Co-authored-by: Gabriel <45515538+gabotechs@users.noreply.github.com> (cherry picked from commit e64e3f7)
Which issue does this PR close?
Rationale for this change
See #24143.
What changes are included in this PR?
__grouping_idin CSE recovery projections for grouping-set aggregates.Are these changes tested?
Yes.
Are there any user-facing changes?
No.