[fix](nereids)SimplifyRange rule may mess up and/or predicate (#26304)
This commit is contained in:
@ -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
|
||||
|
||||
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user