-
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
[fix](nereids) fix UnknownValue's reference in simplify range rule #44637
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
run buildall |
run buildall |
run buildall |
TPC-H: Total hot run time: 40037 ms
|
TPC-DS: Total hot run time: 196853 ms
|
ClickBench: Total hot run time: 33.07 s
|
this.sourceValues = ImmutableList.copyOf(sourceValues); | ||
this.mergeExprOp = mergeExprOp; | ||
} | ||
|
||
private static Expression genReference(List<ValueDesc> sourceValues, Expression toExpr) { |
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 some comment to explain why need generate reference from toExpr
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 some comment to explain why need generate reference from
toExpr
had add comment
public EmptyValue(ExpressionRewriteContext context, Expression reference, Expression exprForNonNull) { | ||
super(context, reference, exprForNonNull); | ||
public EmptyValue(ExpressionRewriteContext context, Expression reference, Expression toExpr) { | ||
super(context, reference, toExpr); | ||
} | ||
|
||
@Override |
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 need to change union
and intersect
of EmptyValue
?
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 need to change
union
andintersect
ofEmptyValue
?
if A op B's references are different, then generate a UnknownValue, this UnknownValue would keep both A and B, no delete any of them.
so if A op B got result is A, or result is B, then we known that A and B's referece must be the same.
so for A op B, if A is EmptyValue, then
- if B's reference different with A's reference, then generate a UnknownValue, UnknownValue's toExpression will keep both A and B
- if B's reference equals to A's reference, then EmptyValue union B = B is ok, EmptyValue intersect B = EmptyValue is ok too.
run buildall |
TPC-H: Total hot run time: 40175 ms
|
TPC-DS: Total hot run time: 197536 ms
|
ClickBench: Total hot run time: 32.56 s
|
run buildall |
TPC-H: Total hot run time: 39555 ms
|
TPC-DS: Total hot run time: 191852 ms
|
ClickBench: Total hot run time: 32.85 s
|
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?
for sql 'a > 10 and b > 20' will generate an UnknowValue with sourceValues = [ Range(a > 10), Range(b > 20) ].
in UnknowValue's constructor, it set reference = sourceValues[0].reference, then its reference = a. This is an error.
when A union/interset B generating an UnknowValue, this UnknownValue's reference should be:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)