-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Fix](nereids) modify the binding aggregate function in order by #32758
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. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
TPC-H: Total hot run time: 38644 ms |
TPC-DS: Total hot run time: 187092 ms |
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
run buildall |
TPC-H: Total hot run time: 38245 ms |
TPC-DS: Total hot run time: 186656 ms |
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
run buildall |
TPC-H: Total hot run time: 38849 ms |
TPC-DS: Total hot run time: 181670 ms |
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
add description |
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindExpression.java
Show resolved
Hide resolved
|
run buildall |
TPC-H: Total hot run time: 37716 ms |
TPC-DS: Total hot run time: 181052 ms |
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
d232508
|
run buildall |
TPC-H: Total hot run time: 39522 ms |
TPC-DS: Total hot run time: 180809 ms |
ClickBench: Total hot run time: 30.01 s |
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
PR approved by at least one committer and no changes requested. |
) modify the bind logical to make the order by has same behavior with mysql when sort child is aggregate. when an order by Expr has aggregate function, all slots in this order by Expr should bind the LogicalAggregate non-AggFunction outputs first, then bind the LogicalAggregate Child e.g. select 2*abs(sum(c1)) as c1, c1,sum(c1)+c1 from t_order_by_bind_priority group by c1 order by sum(c1)+c1 asc; in this sql, the two c1 in order by all bind to the c1 in t_order_by_bind_priority
) Do same job with pr #32758 and pr #33843. Because the master branch2.0 differ in binding order by expressions. So this pr is not a cherry-pick, but actually does same job. For each order by expression: If it does not have aggregate functions, firstly bind expression from aggregate outputs. If not found, then bind expression from aggregate child outputs. If it has aggregate functions, firstly bind expression from aggregate outputs which do not have aggregate functions. If not found, then bind expression from aggregate child outputs. Co-authored-by: feiniaofeiafei <moailing@selectdb.com>
…che#34606) Do same job with pr apache#32758 and pr apache#33843. Because the master branch2.0 differ in binding order by expressions. So this pr is not a cherry-pick, but actually does same job. For each order by expression: If it does not have aggregate functions, firstly bind expression from aggregate outputs. If not found, then bind expression from aggregate child outputs. If it has aggregate functions, firstly bind expression from aggregate outputs which do not have aggregate functions. If not found, then bind expression from aggregate child outputs. Co-authored-by: feiniaofeiafei <moailing@selectdb.com>
modify the bind logical to make the order by has same behavior with mysql when sort child is aggregate.
when an order by Expr has aggregate function, all slots in this order by Expr should bind the LogicalAggregate non-AggFunction outputs first, then bind the LogicalAggregate Child
e.g.
select 2*abs(sum(c1)) as c1, c1,sum(c1)+c1 from t_order_by_bind_priority group by c1 order by sum(c1)+c1 asc;
in this sql, the two c1 in order by all bind to the c1 in t_order_by_bind_priority