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 8, 2024
1 parent 4b8375f commit 5dfad7e
Show file tree
Hide file tree
Showing 3 changed files with 244 additions and 156 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 5dfad7e

Please sign in to comment.