Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4105#discussion_r122712259
  
    --- 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)
           .asInstanceOf[TypeInformation[T]]
     
    +    implicit val accTypeInfo: TypeInformation[ACC] = 
UserDefinedFunctionUtils
    --- End diff --
    
    UDAGGs are sometimes also shared in libraries. If a UDAGG class is included 
in a JAR file and loaded into the classpath, a user can hardly tell whether it 
is implemented in Java or Scala. So, I would not prohibit Scala UDFs in Jave 
environments. However, functions which are intended to be shared should be 
implemented with Java types.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to