danny0405 commented on code in PR #13515:
URL: https://github.com/apache/hudi/pull/13515#discussion_r2361540280


##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieDeleteBlock.java:
##########
@@ -163,15 +170,17 @@ private static DeleteRecord[] deserialize(int version, 
byte[] data) throws IOExc
     } else if (version == 2) {
       return SerializationUtils.deserialize(data);
     } else {
-      DatumReader<HoodieDeleteRecordList> reader = new 
SpecificDatumReader<>(HoodieDeleteRecordList.class);
+      GenericDatumReader<IndexedRecord> reader = 
DELETE_RECORD_DESERIALIZER.get();
       BinaryDecoder decoder = DecoderFactory.get().binaryDecoder(data, 0, 
data.length, null);
-      List<HoodieDeleteRecord> deleteRecordList = reader.read(null, decoder)
-          .getDeleteRecordList();
-      return deleteRecordList.stream()
+      Object deleteRecordList = reader.read(null, decoder).get(0);
+      ValidationUtils.checkArgument(
+          deleteRecordList instanceof List,
+          "The delete block has unexpected delete record encoding.");
+      return ((List<IndexedRecord>) deleteRecordList).stream()
           .map(record -> DeleteRecord.create(
-              record.getRecordKey(),
-              record.getPartitionPath(),
-              unwrapAvroValueWrapper(record.getOrderingVal())))
+              (String) record.get(ORD_RECORD_KEY),
+              (String) record.get(ORD_PARTITION_PATH),
+              unwrapAvroValueWrapper(record.get(ORD_ORDERING_VAL))))

Review Comment:
   do we micro-benchmark this for perf discrepancies, guess it's sould be very 
near.



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