godfreyhe 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_r389695314
 
 

 ##########
 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:
   I find that the comment in 
`RelDataTypeFactoryImpl#createTypeWithNullability` says `According to the SQL 
standard, nullability for struct types can be defined only for columns, which 
translates to top level structs. Nested struct attributes are always nullable, 
so in principle we could always set the nested attributes to be nullable.` 
   we do not follow the SQL standard here ?

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