-
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
[opt](nereids) compare literal not convert to legacy literal and fix ip literal compareTo always equals 0 #46482
base: master
Are you sure you want to change the base?
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
run buildall |
1 similar comment
run buildall |
TPC-H: Total hot run time: 33001 ms
|
TPC-DS: Total hot run time: 196459 ms
|
ClickBench: Total hot run time: 31.42 s
|
run buildall |
2 similar comments
run buildall |
run buildall |
TPC-H: Total hot run time: 32945 ms
|
TPC-DS: Total hot run time: 190010 ms
|
ClickBench: Total hot run time: 31.42 s
|
run buildall |
TPC-H: Total hot run time: 32593 ms
|
TPC-DS: Total hot run time: 189945 ms
|
ClickBench: Total hot run time: 30.98 s
|
run buildall |
2 similar comments
run buildall |
run buildall |
TPC-H: Total hot run time: 32749 ms
|
TPC-DS: Total hot run time: 194359 ms
|
ClickBench: Total hot run time: 31.87 s
|
run buildall |
TPC-H: Total hot run time: 32736 ms
|
TPC-DS: Total hot run time: 194436 ms
|
ClickBench: Total hot run time: 32.08 s
|
run external |
1741a9d
to
3187e95
Compare
run buildall |
TPC-H: Total hot run time: 32629 ms
|
TPC-DS: Total hot run time: 186663 ms
|
ClickBench: Total hot run time: 31.06 s
|
3187e95
to
f3840d9
Compare
run buildall |
TPC-H: Total hot run time: 32812 ms
|
TPC-DS: Total hot run time: 188866 ms
|
ClickBench: Total hot run time: 32.21 s
|
run external |
try { | ||
return BooleanLiteral.of(((ComparableLiteral) equalTo.left()) | ||
.compareTo((ComparableLiteral) equalTo.right()) == 0); | ||
} catch (Exception e) { | ||
// left and right maybe not comparable | ||
return BooleanLiteral.of(equalTo.left().equals(equalTo.right())); | ||
} |
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.
add this to try best to avoid throw exception because throw exception are too slow, similar modifications also need to be made in this way
if (equalTo.left() instanceof ComparableLiteral && equalsTo.right() instanceof ComparableLiteral) {
try {
return BooleanLiteral.of(((ComparableLiteral) equalTo.left())
.compareTo((ComparableLiteral) equalTo.right()) == 0);
} catch (Exception e) {
return BooleanLiteral.of(equalTo.left().equals(equalTo.right()));
}
} else {
return BooleanLiteral.of(equalTo.left().equals(equalTo.right()));
}
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.
add this to try best to avoid throw exception because throw exception are too slow, similar modifications also need to be made in this way
if (equalTo.left() instanceof ComparableLiteral && equalsTo.right() instanceof ComparableLiteral) { try { return BooleanLiteral.of(((ComparableLiteral) equalTo.left()) .compareTo((ComparableLiteral) equalTo.right()) == 0); } catch (Exception e) { return BooleanLiteral.of(equalTo.left().equals(equalTo.right())); } } else { return BooleanLiteral.of(equalTo.left().equals(equalTo.right())); }
fix
thisBytes = getStringValue().getBytes("UTF-8"); | ||
otherBytes = ((Literal) other).getStringValue().getBytes("UTF-8"); | ||
} catch (UnsupportedEncodingException e) { | ||
Preconditions.checkState(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.
do not eat the exception. new AnalysisException and wrap UnsupportedEncodingException and then throw 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.
do not eat the exception. new AnalysisException and wrap UnsupportedEncodingException and then throw it
fix
run buildall |
TPC-H: Total hot run time: 33447 ms
|
TPC-DS: Total hot run time: 188563 ms
|
ClickBench: Total hot run time: 31.32 s
|
run cloud_p0 |
run p0 |
1 similar comment
run p0 |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
as #45181 mention, when sorting literals, toLegacyLiteral may cost a lot of time, so compare literal don't use toLegacyLiteral any more.
legacy literal may have an unknown behaviour comparing two values with different data type.
for neredis literals, different data type value compare will throw an exception, it support valid compare with data types:
what's more, this pr also:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)