flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wuchong <...@git.apache.org>
Subject [GitHub] flink pull request #4105: [FLINK-6888] [table] Can not determine TypeInforma...
Date Mon, 19 Jun 2017 02:59:14 GMT
Github user wuchong commented on a diff in the pull request:

    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
    @@ -358,20 +358,27 @@ abstract class TableEnvironment(val config: TableConfig) {
         * Registers an [[AggregateFunction]] under a unique name. Replaces already existing
         * user-defined functions under this name.
    -  private[flink] def registerAggregateFunctionInternal[T: TypeInformation, ACC](
    +  private[flink] def registerAggregateFunctionInternal[T: TypeInformation, ACC: TypeInformation](
           name: String, function: AggregateFunction[T, ACC]): Unit = {
         // check if class not Scala object
         // check if class could be instantiated
    -    val typeInfo: TypeInformation[_] = implicitly[TypeInformation[T]]
    +    val resultTypeInfo: TypeInformation[_] = implicitly[TypeInformation[T]]
    +    val accTypeInfo: TypeInformation[_] = implicitly[TypeInformation[ACC]]
         // register in Table API
         functionCatalog.registerFunction(name, function.getClass)
         // register in SQL API
    -    val sqlFunctions = createAggregateSqlFunction(name, function, typeInfo, typeFactory)
    +    val sqlFunctions = createAggregateSqlFunction(
    --- End diff --
    Hi @fhueske , I think the ACC type extraction is similar to `T` type of `AggreateFunction[T,
ACC]` and `T` type of `TableFunction[T]`. Currently, they are both extracted and add to the
internal representation of UDAGGs and UDTFs. To keep the consistent, I followed the same way
to add the acc type. If we decide to adopt the approach that wrapping the registered functions,
it would be better to make the other type extractions follow this approach.
    What do you think ? 

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.

View raw message