-
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)subquery unnesting get wrong result if correlated conjuncts is not slot_a = slot_b #37644
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: 40164 ms
|
TPC-DS: Total hot run time: 174237 ms
|
ClickBench: Total hot run time: 30.47 s
|
aa0510a
to
32d1619
Compare
run buildall |
TPC-H: Total hot run time: 40233 ms
|
TPC-DS: Total hot run time: 172484 ms
|
ClickBench: Total hot run time: 30.58 s
|
fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Rewriter.java
Show resolved
Hide resolved
newAggOutput.addAll(newGroupby.stream().map(expression -> { | ||
if (expression instanceof Slot) { | ||
return (NamedExpression) expression; | ||
} else { | ||
Alias alias = new Alias(expression); | ||
unCorrelatedExprToSlot.put(expression, alias.toSlot()); | ||
return alias; | ||
} | ||
}).collect(ImmutableList.toImmutableList())); |
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.
do not use stream api
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.
done
32d1619
to
5502b65
Compare
run buildall |
TPC-H: Total hot run time: 40013 ms
|
TPC-DS: Total hot run time: 174594 ms
|
ClickBench: Total hot run time: 30.83 s
|
run External |
run external |
run buildall |
5502b65
to
e4e11cf
Compare
run buildall |
TPC-H: Total hot run time: 40208 ms
|
TPC-DS: Total hot run time: 173244 ms
|
ClickBench: Total hot run time: 30.56 s
|
run buildall |
TPC-H: Total hot run time: 39864 ms
|
TPC-DS: Total hot run time: 173195 ms
|
ClickBench: Total hot run time: 30.53 s
|
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
…ncts is not slot_a = slot_b (#37644) sql: `select * from t1 where t1.c1 < (select max(t2.c1) from t2 where t1.c2 = abs(t2.c2));` before this pr, we would use the equivalent sql as bellow, which is wrong `select t1.* from t1 semi join ( select t2.c2 as c2, max(t2.c1) as c1 from t2 group by t2.c ) tx on t1.c1 < tx.c1 and t1.c2 = tx.c2;` the pr fix the problem and get the correct one as: `select t1.* from t1 semi join ( select abs(t2.c2) as c2, max(t2.c1) as c1 from t2 group by abs(t2.c) ) tx on t1.c1 < tx.c1 and t1.c2 = tx.c2;`
…ncts is not slot_a = slot_b (apache#37644) (apache#37684) pick from master apache#37644
sql:
select * from t1 where t1.c1 < (select max(t2.c1) from t2 where t1.c2 = abs(t2.c2));
before this pr, we would use the equivalent sql as bellow, which is wrong
select t1.* from t1 semi join ( select t2.c2 as c2, max(t2.c1) as c1 from t2 group by t2.c ) tx on t1.c1 < tx.c1 and t1.c2 = tx.c2;
the pr fix the problem and get the correct one as:
select t1.* from t1 semi join ( select abs(t2.c2) as c2, max(t2.c1) as c1 from t2 group by abs(t2.c) ) tx on t1.c1 < tx.c1 and t1.c2 = tx.c2;
Proposed changes
Issue Number: close #xxx