wzx140 commented on code in PR #5522:
URL: https://github.com/apache/hudi/pull/5522#discussion_r873366141


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -257,46 +255,45 @@ protected void init(String fileId, 
Iterator<HoodieRecord<T>> newRecordsItr) {
         + ((ExternalSpillableMap) 
keyToNewRecords).getSizeOfFileOnDiskInBytes());
   }
 
-  private boolean writeUpdateRecord(HoodieRecord<T> hoodieRecord, 
GenericRecord oldRecord, Option<IndexedRecord> indexedRecord) {
+  private boolean writeUpdateRecord(HoodieRecord<T> hoodieRecord, 
HoodieRecord<T> oldRecord, Option<HoodieRecord> combineRecordOp) throws 
IOException {
     boolean isDelete = false;
-    if (indexedRecord.isPresent()) {
+    Schema schema = useWriterSchemaForCompaction ? tableSchemaWithMetaFields : 
tableSchema;
+    if (combineRecordOp.isPresent()) {
       updatedRecordsWritten++;
-      GenericRecord record = (GenericRecord) indexedRecord.get();
-      if (oldRecord != record) {
+      if (!oldRecord.equals(combineRecordOp.get())) {

Review Comment:
   `oldRecord` can not be null. Becase oldRecord is directly read from 
HoodieAvroFileReader



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