herunkang2018 commented on code in PR #3279:
URL: https://github.com/apache/calcite/pull/3279#discussion_r1248372205
##########
core/src/main/java/org/apache/calcite/plan/RelOptPredicateList.java:
##########
@@ -236,14 +236,18 @@ public boolean isEffectivelyNotNull(RexNode e) {
}
}
if (SqlKind.COMPARISON.contains(e.getKind())) {
- // A comparison with a (non-null) literal, such as 'ref < 10', is not
null if 'ref'
- // is not null.
+ // A comparison with a (non-null) literal, such as 'ref < 10', or '10 <
ref',
+ // is not null if 'ref' is not null.
List<RexNode> operands = ((RexCall) e).getOperands();
// We can have just one operand in case e.g. of a RexSubQuery with IN
operator.
if (operands.size() > 1 && operands.get(1) instanceof RexLiteral
&& !((RexLiteral) operands.get(1)).isNull()) {
return isEffectivelyNotNull(operands.get(0));
}
+ if (operands.size() > 1 && operands.get(0) instanceof RexLiteral
+ && !((RexLiteral) operands.get(0)).isNull()) {
+ return isEffectivelyNotNull(operands.get(1));
+ }
Review Comment:
For the first advice, the RexLiteral doesn't need to process seperately, it
is covered by L229.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]