wuchong commented on a change in pull request #11674: [FLINK-16887][table-planner-blink] Refactor retraction rules to support inferring ChangelogMode URL: https://github.com/apache/flink/pull/11674#discussion_r407329570
########## File path: flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/planner/plan/rules/physical/stream/RetractionRulesWithTwoStageAggTest.xml ########## @@ -39,19 +39,19 @@ LogicalAggregate(group=[{0}], frequency=[COUNT($0)]) </Resource> <Resource name="planAfter"> <![CDATA[ -GlobalGroupAggregate(groupBy=[cnt], select=[cnt, COUNT_RETRACT(count$0) AS frequency], updateAsRetraction=[false], accMode=[Acc]) -+- Exchange(distribution=[hash[cnt]], updateAsRetraction=[true], accMode=[Acc]) - +- LocalGroupAggregate(groupBy=[cnt], select=[cnt, COUNT_RETRACT(cnt) AS count$0, COUNT_RETRACT(*) AS count1$1], updateAsRetraction=[true], accMode=[Acc]) - +- Union(all=[true], union=[cnt], updateAsRetraction=[true], accMode=[AccRetract]) - :- Calc(select=[CAST(cnt) AS cnt], updateAsRetraction=[true], accMode=[AccRetract]) - : +- GlobalGroupAggregate(groupBy=[word], select=[word, COUNT(count$0) AS cnt], updateAsRetraction=[true], accMode=[AccRetract]) - : +- Exchange(distribution=[hash[word]], updateAsRetraction=[true], accMode=[Acc]) - : +- LocalGroupAggregate(groupBy=[word], select=[word, COUNT(number) AS count$0], updateAsRetraction=[true], accMode=[Acc]) - : +- MiniBatchAssigner(interval=[1000ms], mode=[ProcTime], updateAsRetraction=[true], accMode=[Acc]) - : +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(word, number)]]], fields=[word, number], updateAsRetraction=[true], accMode=[Acc]) - +- Calc(select=[cnt], updateAsRetraction=[true], accMode=[Acc]) - +- MiniBatchAssigner(interval=[1000ms], mode=[ProcTime], updateAsRetraction=[true], accMode=[Acc]) - +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(word, cnt)]]], fields=[word, cnt], updateAsRetraction=[true], accMode=[Acc]) +GlobalGroupAggregate(groupBy=[cnt], select=[cnt, COUNT_RETRACT(count$0) AS frequency], changelogMode=[I,UA,D]) ++- Exchange(distribution=[hash[cnt]], changelogMode=[I]) + +- LocalGroupAggregate(groupBy=[cnt], select=[cnt, COUNT_RETRACT(cnt) AS count$0, COUNT_RETRACT(*) AS count1$1], changelogMode=[I]) Review comment: It is as expected. LocalAggregate will emit accumulators to global aggregates. All the accumulators are encoded in insert messages. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services