[ 
https://issues.apache.org/jira/browse/FLINK-34258?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jane Chan reassigned FLINK-34258:
---------------------------------

    Assignee: Jane Chan

> Incorrect example of accumulator usage within emitUpdateWithRetract for 
> TableAggregateFunction
> ----------------------------------------------------------------------------------------------
>
>                 Key: FLINK-34258
>                 URL: https://issues.apache.org/jira/browse/FLINK-34258
>             Project: Flink
>          Issue Type: Bug
>          Components: Documentation, Table SQL / API
>    Affects Versions: 1.19.0, 1.18.1
>            Reporter: Jane Chan
>            Assignee: Jane Chan
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: GroupTableAggHandler$10.java
>
>
> The 
> [documentation|https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/functions/udfs/#retraction-example]
>  provides an example of using `emitUpdateWithRetract`. However, the example 
> is misleading as it incorrectly suggests that the accumulator can be updated 
> within the `emitUpdateWithRetract method`. In reality, the order of 
> invocation is to first call `getAccumulator` and then 
> `emitUpdateWithRetract`, which means that updating the accumulator within 
> `emitUpdateWithRetract` will not take effect. Please see 
> [GroupTableAggFunction#L141|https://github.com/apache/flink/blob/20450485b20cb213b96318b0c3275e42c0300e15/flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/aggregate/GroupTableAggFunction.java#L141]
>  ~ 
> [GroupTableAggFunction#L146|https://github.com/apache/flink/blob/20450485b20cb213b96318b0c3275e42c0300e15/flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/aggregate/GroupTableAggFunction.java#L146]
>  for more details.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to