You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by st...@apache.org on 2023/11/03 12:38:14 UTC
(doris) branch master updated: [fix](nereids)SimplifyRange rule may mess up and/or predicate (#26304)
This is an automated email from the ASF dual-hosted git repository.
starocean999 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 11059ca4edc [fix](nereids)SimplifyRange rule may mess up and/or predicate (#26304)
11059ca4edc is described below
commit 11059ca4edcf34f9c00cae44ae3688e38e37e255
Author: starocean999 <40...@users.noreply.github.com>
AuthorDate: Fri Nov 3 20:38:07 2023 +0800
[fix](nereids)SimplifyRange rule may mess up and/or predicate (#26304)
---
.../org/apache/doris/nereids/rules/expression/rules/SimplifyRange.java | 2 +-
.../org/apache/doris/nereids/rules/expression/SimplifyRangeTest.java | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyRange.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyRange.java
index 392207bf9aa..2fd7f4167d8 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyRange.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyRange.java
@@ -450,7 +450,7 @@ public class SimplifyRange extends AbstractExpressionRewriteRule {
@Override
public ValueDesc intersect(ValueDesc other) {
Expression originExpr = ExpressionUtils.and(expr, other.expr);
- return new UnknownValue(ImmutableList.of(this, other), originExpr, ExpressionUtils::or);
+ return new UnknownValue(ImmutableList.of(this, other), originExpr, ExpressionUtils::and);
}
@Override
diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/SimplifyRangeTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/SimplifyRangeTest.java
index 8058137b6f6..33a22dae78d 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/SimplifyRangeTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/SimplifyRangeTest.java
@@ -104,6 +104,7 @@ public class SimplifyRangeTest {
assertRewrite("TA in (1) and TA in (1)", "TA = 1");
assertRewrite("(TA > 3 and TA < 1) and TB < 5", "FALSE");
assertRewrite("(TA > 3 and TA < 1) or TB < 5", "TB < 5");
+ assertRewrite("((IA = 1 AND SC ='1') OR SC = '1212') AND IA =1", "((IA = 1 AND SC ='1') OR SC = '1212') AND IA =1");
}
private void assertRewrite(String expression, String expected) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org