[ https://issues.apache.org/jira/browse/FLINK-6361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15982035#comment-15982035 ]
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_r113065861 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/CodeGenerator.scala --- @@ -471,31 +480,36 @@ class CodeGenerator( j""" | ${accTypes(i)} aAcc$i = (${accTypes(i)}) a.getField($i); | ${accTypes(i)} bAcc$i = (${accTypes(i)}) b.getField(${mapping(i)}); - | accList$i.set(0, aAcc$i); - | accList$i.set(1, bAcc$i); - | a.setField( - | $i, - | ${aggs(i)}.merge(accList$i)); + | accList$i.set(0, bAcc$i); + | ${aggs(i)}.merge(aAcc$i, accList$i); --- End diff -- `ArrayList` creates a new `Iterator` object everytime `ArrayList.iterator()` is call. We might want to implement our own single element `Iterable` to avoid that overhead. > 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)