vlsi commented on a change in pull request #2144:
URL: https://github.com/apache/calcite/pull/2144#discussion_r485468654



##########
File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
##########
@@ -2690,7 +2691,14 @@ int complexity() {
     }
 
     @Override public RelDataType getType() {
-      return rexBuilder.typeFactory.leastRestrictive(Util.distinctList(types));
+      if (this.types.isEmpty()) {
+        // Expression is "x IS NULL"
+        return ref.getType();

Review comment:
       It looks strange that `ref.getType()` is considered only in the case of 
`null-only` sarg.
   Should it be included to `this.types` in the constructor instead, so the 
types are handled in a uniform way?




----------------------------------------------------------------
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:
[email protected]


Reply via email to