Skip to content

Commit

Permalink
[fix](nereids)SimplifyRange rule may mess up and/or predicate (apache…
Browse files Browse the repository at this point in the history
  • Loading branch information
starocean999 authored and seawinde committed Nov 12, 2023
1 parent aef9eee commit 1de790f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ public ValueDesc union(ValueDesc other) {
@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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public void testSimplify() {
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) {
Expand Down

0 comments on commit 1de790f

Please sign in to comment.