zhongyujiang commented on code in PR #5000:
URL: https://github.com/apache/paimon/pull/5000#discussion_r1959355670


##########
paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/AggregateMergeFunction.java:
##########
@@ -63,11 +65,25 @@ public AggregateMergeFunction(
     public void reset() {
         this.latestKv = null;
         this.row = new GenericRow(getters.length);
+        this.initialKv = null;
+        this.isInitialized = false;
         Arrays.stream(aggregators).forEach(FieldAggregator::reset);
     }
 
     @Override
     public void add(KeyValue kv) {
+        if (initialKv == null) {
+            initialKv = kv;

Review Comment:
   While, this looks like a bug to me, I remember that I previously submitted a 
related issue #4670.
   
   I'm fine with not including the fix for this issue in this PR since it is 
beyond the scope of #4999.
   
   @yuzelin What do you think? Can you help review? Thanks!
   
   
   



-- 
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