-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[fix](nereids) fix push down non-foldable filter through project #47989
[fix](nereids) fix push down non-foldable filter through project #47989
Conversation
run buildall |
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
run buildall |
run buildall |
run buildall |
TPC-H: Total hot run time: 31468 ms
|
// Forbidden filter-project, we must make filter-project -> project-filter. | ||
// except that the project contains NoneMovableFunction | ||
if (child instanceof PhysicalProject && !((PhysicalProject<?>) child).containsNoneMovableFunction()) { | ||
if (child instanceof PhysicalProject && !((PhysicalProject<?>) child).containsNoneMovableFunction() | ||
&& filter.getInputSlots().stream().map(((PhysicalProject<?>) child).getAliasToProducer()::get) | ||
.noneMatch(expr -> expr != null && expr.containsNonfoldable())) { | ||
throw new AnalysisException( | ||
"Nereids generate a filter-project plan, but backend not support:\n" + filter.treeString()); | ||
} |
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.
i think we could remove this if statement directly, because we have processed filter-project in translator
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.
i think we could remove this if statement directly, because we have processed filter-project in translator
had remove
TPC-DS: Total hot run time: 190016 ms
|
ClickBench: Total hot run time: 30.51 s
|
run buildall |
run buildall |
1 similar comment
run buildall |
run buildall |
TPC-H: Total hot run time: 31871 ms
|
TPC-DS: Total hot run time: 189612 ms
|
ClickBench: Total hot run time: 30.3 s
|
run buildall |
TPC-H: Total hot run time: 31891 ms
|
TPC-DS: Total hot run time: 183454 ms
|
ClickBench: Total hot run time: 30.42 s
|
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
…che#47989) When the expression contains slots which is an alias and its original expression is non-foldable, then this expression cann't push down through project. For example: ```filter(b > 1) -> project(a + random(1, 10) as b)```, if push down , it will got ```project(a + random(1, 10) as b) -> filter(a + random(1, 10) > 1)```, it will contains two distinct RANDOM function. This is an error. But if the filter expression itself contains non-foldable expression, it can still push down. For example: ```filter(a + random(1, 10) > 1) -> project(a)```, it can still push down the filter, and got ```project(a) -> filter(a + random(1, 10) > 1)```.
What problem does this PR solve?
When the expression contains slots which is an alias and its original expression is non-foldable, then this expression cann't push down through project. For example:
filter(b > 1) -> project(a + random(1, 10) as b)
,if push down , it will got
project(a + random(1, 10) as b) -> filter(a + random(1, 10) > 1)
,it will contains two distinct RANDOM function. This is an error.
But if the filter expression itself contains non-foldable expression, it can still push down. For example:
filter(a + random(1, 10) > 1) -> project(a)
,it can still push down the filter, and got
project(a) -> filter(a + random(1, 10) > 1)
.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)