englefly commented on code in PR #45310:
URL: https://github.com/apache/doris/pull/45310#discussion_r1883189291
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/RangeInference.java:
##########
@@ -130,10 +132,22 @@ private ValueDesc simplify(ExpressionRewriteContext
context,
Expression originExpr, List<Expression> predicates,
BinaryOperator<ValueDesc> op, boolean isAnd) {
+ boolean convertIsNullToEmptyValue = isAnd &&
predicates.stream().anyMatch(expr -> expr instanceof NullLiteral);
Review Comment:
it is better to check if predicates contains "isNull" and "null" literal.
if match, return EmtpyValue directly, and skip the for loop in line138-150
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/RangeInference.java:
##########
@@ -469,6 +486,9 @@ public ValueDesc union(ValueDesc other) {
@Override
public ValueDesc intersect(ValueDesc other) {
+ if (other instanceof EmptyValue) {
+ return other.intersect(this);
Review Comment:
why not return EmptyValue?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]