twalthr commented on a change in pull request #11260: 
[FLINK-16344][table-planner-blink] Preserve nullability for nested types
URL: https://github.com/apache/flink/pull/11260#discussion_r389748177
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/calcite/FlinkTypeFactory.scala
 ##########
 @@ -293,6 +293,11 @@ class FlinkTypeFactory(typeSystem: RelDataTypeSystem) 
extends JavaTypeFactoryImp
       case it: TimeIndicatorRelDataType =>
         new TimeIndicatorRelDataType(it.typeSystem, it.originalType, 
isNullable, it.isEventTime)
 
+      // for nested rows we keep the nullability property,
+      // top-level rows fall back to Calcite's default handling
+      case rt: RelRecordType if rt.getStructKind == 
StructKind.PEEK_FIELDS_NO_EXPAND =>
 
 Review comment:
   Yes, I also saw this comment. That's why I only fixed a bug around nested 
rows in this PR. However, if we are looking for more efficient plans we should 
further investigate this shortcoming. I recommend to remove `if 
rt.getStructKind == StructKind.PEEK_FIELDS_NO_EXPAND` to see the resulting 
plans esp. around joins. Would definitely be a follow-up issue.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to