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

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

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

    https://github.com/apache/flink/pull/3762#discussion_r113072758
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala
 ---
    @@ -1232,12 +1266,20 @@ object AggregateUtil {
       }
     
       private def createAccumulatorType(
    -      aggregates: Array[TableAggregateFunction[_]]): 
Seq[TypeInformation[_]] = {
    +      aggregates: Array[TableAggregateFunction[_,_]]): 
Seq[TypeInformation[_]] = {
     
         val aggTypes: Seq[TypeInformation[_]] =
           aggregates.map {
             agg =>
    -          val accType = agg.getAccumulatorType
    +          var accType: TypeInformation[_] = null
    --- End diff --
    
    change to
    ```
    val accType = try {
      val method: Method = agg.getClass.getMethod("getAccumulatorType")
      method.invoke(agg).asInstanceOf[TypeInformation[_]]
    } catch {
      case _: NoSuchMethodException => null
      case ite: Throwable => throw new TableException("Unexpected exception:", 
ite)
    }
    ```


> Finalize the AggregateFunction interface and refactoring built-in aggregates
> ----------------------------------------------------------------------------
>
>                 Key: FLINK-6361
>                 URL: https://issues.apache.org/jira/browse/FLINK-6361
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>            Reporter: Shaoxuan Wang
>            Assignee: Shaoxuan Wang
>
> We have completed codeGen for all aggregate runtime functions. Now we can 
> finalize the AggregateFunction. This includes 1) remove Accumulator trait; 2) 
> remove accumulate, retract, merge, resetAccumulator, getAccumulatorType 
> methods from interface, and allow them as contracted methods for UDAGG; 3) 
> refactoring the built-in aggregates accordingly.



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

Reply via email to