Skip to content

Commit

Permalink
[fix](Nereids) simplify range result wrong when reference is nullable
Browse files Browse the repository at this point in the history
if reference is nullable and simplify result should be

IF(${reference} IS NULL, ${nullable_result}, ${not_null_result})
  • Loading branch information
morrySnow committed Oct 14, 2024
1 parent b8b9333 commit eccf9b1
Show file tree
Hide file tree
Showing 4 changed files with 259 additions and 163 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public List<ExpressionPatternMatcher<? extends Expression>> buildRules() {

public Expression rewriteTree(Expression expr, ExpressionRewriteContext context) {
if (expr instanceof CompoundPredicate) {
expr = SimplifyRange.rewrite((CompoundPredicate) expr);
expr = SimplifyRange.rewrite((CompoundPredicate) expr, context);
}
ExpressionBottomUpRewriter bottomUpRewriter = ExpressionRewrite.bottomUp(this);
return bottomUpRewriter.rewrite(expr, context);
Expand Down
Loading

0 comments on commit eccf9b1

Please sign in to comment.