morrySnow commented on code in PR #44637: URL: https://github.com/apache/doris/pull/44637#discussion_r1859718676
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyRange.java: ########## @@ -498,41 +494,53 @@ private UnknownValue(ExpressionRewriteContext context, Expression expr) { mergeExprOp = null; } - public UnknownValue(ExpressionRewriteContext context, - List<ValueDesc> sourceValues, Expression exprForNonNull, BinaryOperator<Expression> mergeExprOp) { - super(context, sourceValues.get(0).reference, exprForNonNull); + public UnknownValue(ExpressionRewriteContext context, Expression toExpr, + List<ValueDesc> sourceValues, BinaryOperator<Expression> mergeExprOp) { + super(context, genReference(sourceValues, toExpr), toExpr); this.sourceValues = ImmutableList.copyOf(sourceValues); this.mergeExprOp = mergeExprOp; } + private static Expression genReference(List<ValueDesc> sourceValues, Expression toExpr) { Review Comment: add some comment to explain why need generate reference from `toExpr` ########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyRange.java: ########## @@ -271,8 +271,8 @@ public static ValueDesc discrete(ExpressionRewriteContext context, InPredicate i private static class EmptyValue extends ValueDesc { - public EmptyValue(ExpressionRewriteContext context, Expression reference, Expression exprForNonNull) { - super(context, reference, exprForNonNull); + public EmptyValue(ExpressionRewriteContext context, Expression reference, Expression toExpr) { + super(context, reference, toExpr); } @Override Review Comment: do not need to change `union` and `intersect` of `EmptyValue`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org