[ https://issues.apache.org/jira/browse/FLINK-4294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15580345#comment-15580345 ]
ASF GitHub Bot commented on FLINK-4294: --------------------------------------- Github user twalthr commented on a diff in the pull request: https://github.com/apache/flink/pull/2319#discussion_r83556947 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/FlinkTypeFactory.scala --- @@ -79,14 +83,27 @@ class FlinkTypeFactory(typeSystem: RelDataTypeSystem) extends JavaTypeFactoryImp } private def createAdvancedType(typeInfo: TypeInformation[_]): RelDataType = typeInfo match { - // TODO add specific RelDataTypes - // for PrimitiveArrayTypeInfo, ObjectArrayTypeInfo, CompositeType + case ct: CompositeType[_] => + new CompositeRelDataType(ct, this) + + // TODO add specific RelDataTypes for PrimitiveArrayTypeInfo, ObjectArrayTypeInfo case ti: TypeInformation[_] => new GenericRelDataType(typeInfo, getTypeSystem.asInstanceOf[FlinkTypeSystem]) case ti@_ => throw TableException(s"Unsupported type information: $ti") } + + override def createTypeWithNullability( + relDataType: RelDataType, + nullable: Boolean) + : RelDataType = relDataType match { + case composite: CompositeRelDataType => + // at the moment we do not care about nullability --- End diff -- `CompositeRelDataType` is the first custom type and thus not supported by the superclass (`JavaTypeFactory`) that's why I had to override this method. The super method does some copying logic and sets the nullability of every field of the record. At the moment every field in the Table API can be null anyway, so I skipped this logic here until we provide full nullabilty support through the entire API. > Allow access of composite type fields > ------------------------------------- > > Key: FLINK-4294 > URL: https://issues.apache.org/jira/browse/FLINK-4294 > Project: Flink > Issue Type: New Feature > Components: Table API & SQL > Reporter: Timo Walther > Assignee: Timo Walther > > Currently all Flink CompositeTypes are treated as GenericRelDataTypes. It > would be better to access individual fields of composite types, too. e.g. > {code} > SELECT composite.name FROM composites > SELECT tuple.f0 FROM tuples > 'f0.getField(0) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)