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 03:11:53 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/java/BatchTableEnvironment.scala
    @@ -192,10 +193,14 @@ class BatchTableEnvironment(
           name: String,
           f: AggregateFunction[T, ACC])
       : Unit = {
    -    implicit val typeInfo: TypeInformation[T] = TypeExtractor
    -      .createTypeInfo(f, classOf[AggregateFunction[T, ACC]], f.getClass, 0)
    +    implicit val typeInfo: TypeInformation[T] = UserDefinedFunctionUtils
    +      .getResultTypeOfAggregateFunction(f)
    +    implicit val accTypeInfo: TypeInformation[ACC] = UserDefinedFunctionUtils
    --- End diff --
    I agree with you. But this PR is only to fix Scala classes can't work in the Scala TableEnvironments.
In general, users create Scala classes and naturally will use it in Scala TableEnvironments.
Registering a Scala class into Java TableEnvironments is not recommended (should forbidden).
This is the same with that Scala `T` classes of `Aggregate[T, _] and TableFunction[T]` works
in Scala TableEnvironments.

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