[ 
https://issues.apache.org/jira/browse/FLINK-5906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15995080#comment-15995080
 ] 

ASF GitHub Bot commented on FLINK-5906:
---------------------------------------

Github user shaoxuan-wang commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3809#discussion_r114576600
  
    --- 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 --
    
    Thanks @twalthr .  If I understand you correctly, you suggest to create a 
contract method `getResultType` for UDAGG, such that user can provide the 
result type in case the type extraction fails. Sounds good to me? 
    Can you give some examples that when the type extraction will fail (for 
instance a Row type?) and why it may fail, such that I can add some test cases. 
 


> Add support to register UDAGG in Table and SQL API
> --------------------------------------------------
>
>                 Key: FLINK-5906
>                 URL: https://issues.apache.org/jira/browse/FLINK-5906
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>            Reporter: Fabian Hueske
>            Assignee: Shaoxuan Wang
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to