flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twalthr <...@git.apache.org>
Subject [GitHub] flink pull request #2319: [FLINK-4294] [table] Allow access of composite typ...
Date Sun, 16 Oct 2016 18:27:55 GMT
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message