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

    https://github.com/apache/flink/pull/3809#discussion_r114581240
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala
 ---
    @@ -178,4 +178,24 @@ class BatchTableEnvironment(
     
         registerTableFunctionInternal[T](name, tf)
       }
    +
    +  /**
    +    * Registers an [[AggregateFunction]] under a unique name in the 
TableEnvironment's catalog.
    +    * Registered functions can be referenced in Table API and SQL queries.
    +    *
    +    * @param name The name under which the function is registered.
    +    * @param f The AggregateFunction to register.
    +    * @tparam T The type of the output value.
    +    * @tparam ACC The type of aggregate accumulator.
    +    */
    +  def registerFunction[T, ACC](
    +      name: String,
    +      f: AggregateFunction[T, ACC])
    +  : Unit = {
    +    implicit val typeInfo: TypeInformation[T] = TypeExtractor
    --- End diff --
    
    The idea would be to always check `getResultType()` first and only use the 
type extractor if the method is not implemented. So you would not need to 
enforce a TypeExtractor failure for the tests.


---
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