asolimando commented on code in PR #4139:
URL: https://github.com/apache/calcite/pull/4139#discussion_r1917348428
##########
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:
I guess so, because implementers will have to add support for it
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]