danny0405 commented on a change in pull request #4932: URL: https://github.com/apache/hudi/pull/4932#discussion_r817464786
########## File path: hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieMergedLogRecordScanner.java ########## @@ -143,9 +143,11 @@ protected void processNextRecord(HoodieRecord<? extends HoodieRecordPayload> hoo HoodieRecord<? extends HoodieRecordPayload> oldRecord = records.get(key); HoodieRecordPayload oldValue = oldRecord.getData(); HoodieRecordPayload combinedValue = hoodieRecord.getData().preCombine(oldValue); - boolean choosePrev = combinedValue.equals(oldValue); - HoodieOperation operation = choosePrev ? oldRecord.getOperation() : hoodieRecord.getOperation(); - records.put(key, new HoodieAvroRecord<>(new HoodieKey(key, hoodieRecord.getPartitionPath()), combinedValue, operation)); + // If combinedValue is oldValue, no need rePut oldRecord + if (!combinedValue.equals(oldValue)) { + HoodieOperation operation = hoodieRecord.getOperation(); Review comment: We can use `==` instead which is more efficient. Currently the payload clazz has no uniform `#equals` yet. -- 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: commits-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org