-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[Enhencement](Nereids) rules to optimize length function with aggregate function #33837
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
it is better to do this transformation: It covers more cases. |
if (not.getArgument(0) instanceof EqualPredicate) { | ||
EqualPredicate equalPredicate = (EqualPredicate) not.getArgument(0); | ||
if (equalPredicate.getArgument(0).getDataType().isStringType() | ||
&& equalPredicate.getArgument(1).equals(new StringLiteral(""))) { |
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.
how about varchar or char literal? should check StringLikeLiteral and getStringValue from it
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
EqualPredicate equalPredicate = (EqualPredicate) not.getArgument(0); | ||
if (equalPredicate.getArgument(0).getDataType().isStringType() | ||
&& equalPredicate.getArgument(1).equals(new StringLiteral(""))) { | ||
expr = new GreaterThan(new Length(equalPredicate.getArgument(0)), new IntegerLiteral(0), false); |
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.
use two arg ctor is enough
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
run buildall |
have changed and add more cases abort that |
run buildall |
ecd5ef2
to
ae32abc
Compare
run buildall |
TPC-H: Total hot run time: 38213 ms
|
TPC-DS: Total hot run time: 185541 ms
|
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
run buildall |
TPC-H: Total hot run time: 38516 ms
|
TPC-DS: Total hot run time: 185231 ms
|
ClickBench: Total hot run time: 30.9 s
|
run buildall |
run external |
ea828ba
to
d47e3c1
Compare
run buildall |
ClickBench: Total hot run time: 29.41 s
|
Add two rules in order to optimize plan in clickbench q27
example:
select t1.string from t1 where t1.string <> ""; ==>select t1.string from t1 where length(t1.string) > 0;
select avg(length(t1.string)) from t1;
from agg(length) to agg->project(length)