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

    https://github.com/apache/flink/pull/3694#discussion_r110341810
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateAggFunction.scala
 ---
    @@ -18,69 +18,51 @@
     
     package org.apache.flink.table.runtime.aggregate
     
    -import java.util.{ArrayList => JArrayList, List => JList}
    -import org.apache.flink.api.common.functions.{AggregateFunction => 
DataStreamAggFunc}
    -import org.apache.flink.table.functions.{Accumulator, AggregateFunction}
    +import org.apache.flink.api.common.functions.AggregateFunction
    +import org.apache.flink.table.codegen.{Compiler, 
GeneratedAggregationsFunction}
     import org.apache.flink.types.Row
    +import org.slf4j.LoggerFactory
     
     /**
       * Aggregate Function used for the aggregate operator in
       * [[org.apache.flink.streaming.api.datastream.WindowedStream]]
       *
    -  * @param aggregates       the list of all 
[[org.apache.flink.table.functions.AggregateFunction]]
    -  *                         used for this aggregation
    -  * @param aggFields   the position (in the input Row) of the input value 
for each aggregate
    +  * @param genAggregations Generated aggregate helper function
       */
     class AggregateAggFunction(
    -    private val aggregates: Array[AggregateFunction[_]],
    -    private val aggFields: Array[Array[Int]])
    -  extends DataStreamAggFunc[Row, Row, Row] {
    +    genAggregations: GeneratedAggregationsFunction)
    +  extends AggregateFunction[Row, Row, Row]
    --- End diff --
    
    Rather extend `RichAggregateFunction` and compile the function in the 
`open()` method.
    This would fit the lifecycle of a function better.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to