mihaibudiu commented on code in PR #4139: URL: https://github.com/apache/calcite/pull/4139#discussion_r1917337566
########## core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java: ########## @@ -410,6 +410,31 @@ private RelDataType copyRecordType( return canonize(newType); } + @Override public RelDataType enforceTypeWithNullability( + final RelDataType type, + final boolean nullable) { + requireNonNull(type, "type"); + RelDataType newType; + if (type.isNullable() == nullable) { + newType = type; + } else if (type instanceof RelRecordType) { + return createStructType(type.getStructKind(), + new AbstractList<RelDataType>() { + @Override public RelDataType get(int index) { + return type.getFieldList().get(index).getType(); + } + + @Override public int size() { + return type.getFieldCount(); + } + }, + type.getFieldNames(), nullable); + } else { Review Comment: As far as I can tell the other types are handled correctly by the factory. Only Record types are anomalous. This class (RelDataTypeFactoryImpl) is an abstract base class out of which SqlTypeFactoryImpl is derived. In the end, the SqlTypeFactoryImpl method gets called. -- 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. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org