swuferhong commented on code in PR #21586:
URL: https://github.com/apache/flink/pull/21586#discussion_r1066761596


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/agg/batch/HashAggCodeGenerator.scala:
##########
@@ -202,11 +299,43 @@ class HashAggCodeGenerator(
          |    $dealWithAggHashMapOOM
          |  }
          |}
+         |
+         |$totalCountIncCode
+         |$adaptiveSamplePointCode
+         |
          | // aggregate buffer fields access
          |${ctx.reuseInputUnboxingCode(currentAggBufferTerm)}
          | // do aggregate and update agg buffer
          |${aggregate.code}
+         | // flush result form map if suppress is enable. 
+         |$flushResultIfSuppressEnableCode
          |""".stripMargin.trim
+    } else {
+      s"""

Review Comment:
   > We don't need this repeated code, for local and global agg, the main code 
is reusable. For example, the `adaptiveSuppressCode ` for global agg is "", but 
for local agg is the needed code.
   
   Done!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to