[Feat](nereids) add transform rule SimplifyWindowExpression#33647
[Feat](nereids) add transform rule SimplifyWindowExpression#33647morrySnow merged 10 commits intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
TPC-H: Total hot run time: 38228 ms |
TPC-DS: Total hot run time: 184160 ms |
ClickBench: Total hot run time: 30.26 s |
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
run buildall |
TPC-H: Total hot run time: 38584 ms |
TPC-DS: Total hot run time: 183515 ms |
ClickBench: Total hot run time: 30.08 s |
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
run buildall |
TPC-H: Total hot run time: 38228 ms |
TPC-DS: Total hot run time: 182733 ms |
ClickBench: Total hot run time: 30.57 s |
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
run external |
|
run external regression |
|
run external |
|
run external regression |
|
run buildall |
TPC-H: Total hot run time: 38581 ms |
|
run p0 |
1 similar comment
|
run p0 |
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
| * select max(c1) over(partition by pk) from t1; | ||
| * -> select c1 from t1; | ||
| * */ | ||
| public class SimplifyWindowExpression extends OneRewriteRuleFactory { |
There was a problem hiding this comment.
add annotation @DependsRules for denpends on normalize window
| Alias alias = (Alias) expr; | ||
| WindowExpression windowExpression = (WindowExpression) alias.child(); | ||
| if (!windowExpression.getOrderKeys().isEmpty()) { | ||
| remainWindowExpression.add(expr); |
There was a problem hiding this comment.
if partition key is unique, order key is not use anymore, so why remain them?
There was a problem hiding this comment.
LogicalWindow
->
LogicalProject(projections)
+ LogicalWindow(remainWindowExpression)
remainWindowExpressions are the WindowExpressions that don't meet the conditions for optimization, and still need to be evaluated int LogicalWindow.
There was a problem hiding this comment.
Tthe restriction has been removed
| return new LogicalProject(projections, window.withExpression(remainWindow, | ||
| window.child(0))); |
There was a problem hiding this comment.
do u have case to test this branch? i think this is not right because project should contain remain window node's output
There was a problem hiding this comment.
The problem has been modified and regression cases have been added
|
run buildall |
|
run buildall |
TPC-H: Total hot run time: 38169 ms |
|
run buildall |
|
run buildall |
1 similar comment
|
run buildall |
|
run p0 |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
rewrite func(para) over (partition by unique_keys) 1. func() is count(non-null) or rank/dense_rank/row_number -> 1 2. func(para) is min/max/sum/avg/first_value/last_value -> para e.g select max(c1) over(partition by pk) from t1; -> select c1 from t1;
rewrite func(para) over (partition by unique_keys) 1. func() is count(non-null) or rank/dense_rank/row_number -> 1 2. func(para) is min/max/sum/avg/first_value/last_value -> para e.g select max(c1) over(partition by pk) from t1; -> select c1 from t1;
rewrite func(para) over (partition by unique_keys) 1. func() is count(non-null) or rank/dense_rank/row_number -> 1 2. func(para) is min/max/sum/avg/first_value/last_value -> para e.g select max(c1) over(partition by pk) from t1; -> select c1 from t1;
…pache#37061) intro by apache#33647 after window expression rewritten by literal. literal's data type should same with original window expression.
rewrite func(para) over (partition by unique_keys)
e.g
select max(c1) over(partition by pk) from t1;
-> select c1 from t1;