danny0405 commented on a change in pull request #2019:
URL: https://github.com/apache/calcite/pull/2019#discussion_r440563260
##########
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:
BTW, can you share why you need to compare map and array types ? Seems
the case is rare from my side.
----------------------------------------------------------------
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]