Uh oh!
There was an error while loading. Please reload this page.
[feat](nereids) simplify comparison predicate rule add check data type limit - #44732
Conversation
doris-robot
commented
Nov 28, 2024
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
yujun777
commented
Nov 28, 2024
run buildall |
1 similar comment
yujun777
commented
Nov 28, 2024
run buildall |
| } | ||
| } | ||
| public static Expression getTrue(Expression expression) { |
There was a problem hiding this comment.
maybe trueOrNull is a better name?
There was a problem hiding this comment.
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.
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.
maybe u could use org.apache.common.lang3.StringUtils.repeat
There was a problem hiding this comment.
maybe u could use
org.apache.common.lang3.StringUtils.repeat
fix
67fd0d5 to
476a296Compareyujun777
commented
Nov 29, 2024
run buildall |
c61cf89 to
5517819Compareyujun777
commented
Nov 29, 2024
run buildall |
dd010e3 to
e5ef895Compareyujun777
commented
Nov 29, 2024
run buildall |
4126bab to
7b19651Compareyujun777
commented
Dec 2, 2024
prequire PR: #44831 |
yujun777
commented
Dec 3, 2024
run buildall |
| --------PhysicalLimit[LOCAL] | ||
| ----------PhysicalProject | ||
| ------------PhysicalStorageLayerAggregate[test_pull_up_predicate_literal] | ||
| ------PhysicalProject |
There was a problem hiding this comment.
maybe we should modify pull up's case to ensure not generate PhysicalEmptyRelation
| 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.
same as pull up predicate cases
There was a problem hiding this comment.
same as pull up predicate cases
update
yujun777
commented
Dec 3, 2024
run buildall |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
828bc82 to
a99911eComparea99911e to
90382c9Compare90382c9 to
8201561Compareyujun777
commented
Dec 13, 2024
run buildall |
…e limit (apache#44732) simplify comparison, check data type's limit, like: suppose a is tinyint, so its range should be [-128, 127], then we can simplify: a = -129 => false cast (a as small int) = small int(-129) => false a <= -129 => false a > -129 => true a <= -128 => a = -128 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.
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)