You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/06/30 03:57:17 UTC
[GitHub] [flink] godfreyhe commented on a change in pull request #16219: [FLINK-22781][table-planner-blink] Fix bug in emit behavior of GroupWindowAggregate to skip emit window result if input stream of GroupWindowAggregate contains retraction and input counter of input records for current window is zero
godfreyhe commented on a change in pull request #16219:
URL: https://github.com/apache/flink/pull/16219#discussion_r661111525
##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/operators/window/AggregateWindowOperator.java
##########
@@ -156,35 +160,55 @@ protected void compileGeneratedCode() {
@Override
protected void emitWindowResult(W window) throws Exception {
windowFunction.prepareAggregateAccumulatorForEmit(window);
+ RowData acc = aggWindowAggregator.getAccumulators();
RowData aggResult = aggWindowAggregator.getValue(window);
if (produceUpdates) {
Review comment:
Please add some tests to cover this branch
##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/operators/window/TableAggregateWindowOperator.java
##########
@@ -124,6 +128,9 @@ protected void compileGeneratedCode() {
@Override
protected void emitWindowResult(W window) throws Exception {
windowFunction.prepareAggregateAccumulatorForEmit(window);
- tableAggWindowAggregator.emitValue(window, (RowData) getCurrentKey(), collector);
+ RowData acc = tableAggWindowAggregator.getAccumulators();
+ if (!recordCounter.recordCountIsZero(acc)) {
Review comment:
please add some tests to cover this change
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org