kgyrtkirk commented on a change in pull request #1491: [CALCITE-3368] Some problems simplifying ‘expression IS NULL’ URL: https://github.com/apache/calcite/pull/1491#discussion_r334911068
########## File path: core/src/main/java/org/apache/calcite/rex/RexCall.java ########## @@ -204,7 +204,7 @@ public RelDataType getType() { // This reduction allows us to convert it to a semi-join. switch (getKind()) { case IS_NOT_NULL: - return !operands.get(0).getType().isNullable(); + return RexSimplify.isSafeExpression(this) && !operands.get(0).getType().isNullable(); Review comment: I still feel that this could bite back... * I know it wont be 100% accurate: but I would feel that making the +/-* operators return value nullable regardless the arguments could help avoiding this recursive safetyness check. * ...or annotate the nodes with their safety classification during construction; then we don't need to recurse to obtain this info ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services