-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](project push down) union and its children's output are mis order #58765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
1 similar comment
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 34445 ms |
TPC-DS: Total hot run time: 180274 ms |
ClickBench: Total hot run time: 27.34 s |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 34604 ms |
TPC-DS: Total hot run time: 179917 ms |
ClickBench: Total hot run time: 27.34 s |
Contributor
FE Regression Coverage ReportIncrement line coverage |
starocean999
approved these changes
Dec 8, 2025
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
924060929
approved these changes
Dec 8, 2025
nagisa-kunhah
pushed a commit
to nagisa-kunhah/doris
that referenced
this pull request
Dec 14, 2025
apache#58765) ### What problem does this PR solve? Related PR: apache#57204 Problem Summary: This pull request refactors and improves the `PushDownProject` rule in the Nereids optimizer, mainly focusing on the logic for pushing down projections through `UNION` operations. It also introduces a comprehensive unit test to verify the new logic, making the relevant methods more testable and robust. **Refactoring and Logic Improvements:** * Refactored the `pushThroughUnion` logic by extracting it into a new static method, making it easier to test and use independently. The main logic now takes explicit arguments instead of relying on the context object. * Improved the handling of projections and child outputs when pushing down through `UNION`, ensuring correct mapping and replacement of slots. This includes using regulator outputs for children and constant expressions, and making the slot replacement logic static for better testability. **Testing Enhancements:** * Added a new unit test class `PushDownProjectTest` to rigorously test the pushdown logic in various scenarios, including unions with and without children. The tests verify both the structure and the correctness of the rewritten plans. **Code Quality Improvements:** * Added the `@VisibleForTesting` annotation and imported necessary dependencies to clarify method visibility and intent for testing. * Replaced some usages of `Collection` with `List` for better type safety and clarity in projection handling. These changes make the projection pushdown logic more modular, testable, and robust, and provide strong test coverage for future maintenance.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Related PR: #57204
Problem Summary:
This pull request refactors and improves the
PushDownProjectrule in the Nereids optimizer, mainly focusing on the logic for pushing down projections throughUNIONoperations. It also introduces a comprehensive unit test to verify the new logic, making the relevant methods more testable and robust.Refactoring and Logic Improvements:
pushThroughUnionlogic by extracting it into a new static method, making it easier to test and use independently. The main logic now takes explicit arguments instead of relying on the context object.UNION, ensuring correct mapping and replacement of slots. This includes using regulator outputs for children and constant expressions, and making the slot replacement logic static for better testability. [1] [2] [3] [4]Testing Enhancements:
PushDownProjectTestto rigorously test the pushdown logic in various scenarios, including unions with and without children. The tests verify both the structure and the correctness of the rewritten plans.Code Quality Improvements:
@VisibleForTestingannotation and imported necessary dependencies to clarify method visibility and intent for testing.CollectionwithListfor better type safety and clarity in projection handling.These changes make the projection pushdown logic more modular, testable, and robust, and provide strong test coverage for future maintenance.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)