-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](enforcer) shuffle if has continuous project or filter on cte consumer #58964
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
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-H: Total hot run time: 35797 ms |
TPC-DS: Total hot run time: 182418 ms |
ClickBench: Total hot run time: 27.26 s |
FE Regression Coverage ReportIncrement line coverage |
d642552 to
f924bb4
Compare
|
run buildall |
TPC-H: Total hot run time: 36495 ms |
TPC-DS: Total hot run time: 178500 ms |
ClickBench: Total hot run time: 27.94 s |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
1 similar comment
FE Regression Coverage ReportIncrement line coverage |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
yujun777
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
FE Regression Coverage ReportIncrement line coverage |
…nsumer (#58964) Related PR: #21412 Problem Summary: This pull request improves the handling of distribution properties (specifically "must shuffle") for `PhysicalProject` and `PhysicalFilter` nodes in the query planner, and adds comprehensive unit tests to ensure correctness. The main logic ensures that when certain child nodes require shuffling, the planner correctly adjusts the distribution requirements, especially in the presence of `Project`, `Filter`, and `Limit` nodes. Key changes include: **Distribution Property Handling Enhancements:** * Added logic in `ChildrenPropertiesRegulator` to check if a child node under a `PhysicalProject` or `PhysicalFilter` requires a "must shuffle" distribution, and to adjust the children’s properties accordingly. This is done via the new `mustShuffleUnderProjectOrFilter` method. * Included `PhysicalLimit` in the set of nodes that can trigger a shuffle requirement, by updating imports and logic. **Testing Improvements:** * Added a new test class `ChildrenPropertiesRegulatorTest.java` with detailed unit tests for the handling of "must shuffle" properties under `Project`, `Filter`, and `Limit` nodes. These tests use mocks to simulate various plan trees and assert correct distribution specification propagation. **Regression Test Coverage:** * Added a new regression test in `cte.groovy` to verify correct behavior when multiple `Project` nodes are present on a CTE consumer, ensuring the planner handles such cases as expected. These changes collectively make the planner more robust in handling complex plan trees with respect to distribution requirements, and ensure correctness through thorough testing.
related PR #58964 Problem Summary: This pull request refactors how child physical plans are accessed in the `ChildrenPropertiesRegulator` class, simplifying the code and improving test clarity. The main change is the removal of the `getChildPhysicalPlan` helper method, replacing its usage with direct access to the plan from the `children` list. The tests are also updated to build child mocks more locally, improving test isolation and readability. Refactoring and Simplification: * Removed the `getChildPhysicalPlan` method from `ChildrenPropertiesRegulator`, and replaced its usage in `visitPhysicalFilter` and `visitPhysicalProject` with direct access to the child plan via `children.get(0).getPlan()`. This simplifies the code by eliminating unnecessary indirection.
related PR #58964 Problem Summary: This pull request refactors how child physical plans are accessed in the `ChildrenPropertiesRegulator` class, simplifying the code and improving test clarity. The main change is the removal of the `getChildPhysicalPlan` helper method, replacing its usage with direct access to the plan from the `children` list. The tests are also updated to build child mocks more locally, improving test isolation and readability. Refactoring and Simplification: * Removed the `getChildPhysicalPlan` method from `ChildrenPropertiesRegulator`, and replaced its usage in `visitPhysicalFilter` and `visitPhysicalProject` with direct access to the child plan via `children.get(0).getPlan()`. This simplifies the code by eliminating unnecessary indirection.
What problem does this PR solve?
Related PR: #21412
Problem Summary:
This pull request improves the handling of distribution properties (specifically "must shuffle") for
PhysicalProjectandPhysicalFilternodes in the query planner, and adds comprehensive unit tests to ensure correctness. The main logic ensures that when certain child nodes require shuffling, the planner correctly adjusts the distribution requirements, especially in the presence ofProject,Filter, andLimitnodes.Key changes include:
Distribution Property Handling Enhancements:
ChildrenPropertiesRegulatorto check if a child node under aPhysicalProjectorPhysicalFilterrequires a "must shuffle" distribution, and to adjust the children’s properties accordingly. This is done via the newmustShuffleUnderProjectOrFiltermethod. [1] [2] [3]PhysicalLimitin the set of nodes that can trigger a shuffle requirement, by updating imports and logic. [1] [2]Testing Improvements:
ChildrenPropertiesRegulatorTest.javawith detailed unit tests for the handling of "must shuffle" properties underProject,Filter, andLimitnodes. These tests use mocks to simulate various plan trees and assert correct distribution specification propagation.Regression Test Coverage:
cte.groovyto verify correct behavior when multipleProjectnodes are present on a CTE consumer, ensuring the planner handles such cases as expected.These changes collectively make the planner more robust in handling complex plan trees with respect to distribution requirements, and ensure correctness through thorough testing.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)