diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java index f65e77aab411..cb85c5f1878f 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java +++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java @@ -35,6 +35,8 @@ import java.util.ArrayList; import java.util.List; +import static org.apache.calcite.linq4j.Nullness.castNonNull; + /** * RelDataTypeImpl is an abstract base for implementations of * {@link RelDataType}. @@ -227,7 +229,8 @@ private static void getFieldRecurse(List slots, RelDataType type, * @return SqlTypeName, never null */ @Override public SqlTypeName getSqlTypeName() { - return null; + // The implementations must provide non-null value, however, we keep this for compatibility + return castNonNull(null); } @Override public SqlIdentifier getSqlIdentifier() {