-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[feat](nereids) simplify comparison predicate rule add check data type limit #44732
[feat](nereids) simplify comparison predicate rule add check data type limit #44732
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
run buildall |
1 similar comment
run buildall |
} | ||
} | ||
|
||
public static Expression getTrue(Expression expression) { |
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.
maybe trueOrNull is a better name?
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.
maybe trueOrNull is a better name?
fix
//minVal = BigDecimal.valueOf(-Float.MAX_VALUE); | ||
return Optional.of(Pair.of(new BigDecimal(String.valueOf(Float.MIN_VALUE)), | ||
new BigDecimal(String.valueOf(Float.MAX_VALUE)))); | ||
} else if (dataType.isDoubleType()) { | ||
//minVal = BigDecimal.valueOf(-Double.MAX_VALUE); |
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.
need -Double.MAX_VALUE
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.
need
-Double.MAX_VALUE
fix
if (scale >= 0) { | ||
StringBuilder sb = new StringBuilder(); | ||
for (int i = 0; i < precision - scale; i++) { | ||
sb.append('9'); |
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.
maybe u could use org.apache.common.lang3.StringUtils.repeat
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.
maybe u could use
org.apache.common.lang3.StringUtils.repeat
fix
67fd0d5
to
476a296
Compare
run buildall |
c61cf89
to
5517819
Compare
run buildall |
dd010e3
to
e5ef895
Compare
run buildall |
4126bab
to
7b19651
Compare
prequire PR: #44831 |
run buildall |
--------PhysicalLimit[LOCAL] | ||
----------PhysicalProject | ||
------------PhysicalStorageLayerAggregate[test_pull_up_predicate_literal] | ||
------PhysicalProject |
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.
maybe we should modify pull up's case to ensure not generate PhysicalEmptyRelation
@@ -373,24 +373,13 @@ PhysicalResultSink | |||
|
|||
-- !infer9 -- | |||
PhysicalResultSink | |||
--hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() | |||
----filter((cast(id as BIGINT) = 2147483648)) | |||
------PhysicalOlapScan[t1] |
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.
same as pull up predicate cases
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.
same as pull up predicate cases
update
run buildall |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
828bc82
to
a99911e
Compare
a99911e
to
90382c9
Compare
90382c9
to
8201561
Compare
run buildall |
What problem does this PR solve?
simplify comparison, check data type's limit, like:
suppose a is tinyint, so its range should be [-128, 127], then we can simplify:
currently data type check only support tinyint, small int, int, big int, decimalv3.
if data type is float like, compare them with literal may lost precision, but maybe suport it later.
This PR need more test.
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)