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



##########
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();
+      }
+      final List<RelDataType> distinctTypes = Util.distinctList(this.types);

Review comment:
       I wonder if this can be integrated into `addRange`, so it skips adding 
duplicate items in the first place rather than add duplicates and de-duplicate 
it later.




----------------------------------------------------------------
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