danny0405 commented on a change in pull request #2019:
URL: https://github.com/apache/calcite/pull/2019#discussion_r440723990



##########
File path: core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java
##########
@@ -1151,13 +1151,22 @@ public static boolean equalSansNullability(
       return true;
     }
 
-    if (type1.isNullable() == type2.isNullable()) {
+    if (isAtomic(type1) && isAtomic(type2) && (type1.isNullable() == 
type2.isNullable())) {
       // If types have the same nullability and they weren't equal above,
       // they must be different.
       return false;
     }
-    return type1.equals(
-        factory.createTypeWithNullability(type2, type1.isNullable()));
+    if (isArray(type1) && isArray(type2)) {
+      return equalSansNullability(factory, type1.getComponentType(), 
type2.getComponentType());
+    } else if (isMap(type1) && isMap(type2)) {
+      MapSqlType mType1 = (MapSqlType) type1;

Review comment:
       Reasonable, in `TypeCoercionImpl#querySourceCoercion` we may need to 
take the array element nullability into account.




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


Reply via email to