diff --git a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java index bbad1ca7bcbc..009ef8ff3dff 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java +++ b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java @@ -1202,6 +1202,9 @@ public static boolean equalSansNullability( * @return true if the types are equal or the only difference is nullability */ public static boolean equalSansNullability(RelDataType type1, RelDataType type2) { + if (type1 == type2) { + return true; + } String x = type1.getFullTypeString(); String y = type2.getFullTypeString(); if (x.length() < y.length()) {