neuyilan commented on code in PR #5000:
URL: https://github.com/apache/paimon/pull/5000#discussion_r1959010245
##########
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:
Yes, you are right.
If there are multiple kvs, but all of them are retracts, we still return as
**INSERT** record now.
Do we need to deal with this situation?
--
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]