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


##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieNativeDeleteBlock.java:
##########
@@ -46,51 +52,76 @@ public class HoodieNativeDeleteBlock extends 
HoodieDeleteBlock {
 
   private final HoodieStorage storage;
   private final HoodieLogFile logFile;
-  private final HoodieReaderContext<?> readerContext;
   private final HoodieSchema deleteLogSchema;
   private final List<String> orderingFieldNames;
+  private final String partitionPath;
+  private final Properties props;
+  private DeleteRecord[] recordsToDelete;
   private List<BufferedRecord<?>> bufferedRecordsToDelete;
 
   public HoodieNativeDeleteBlock(HoodieStorage storage,
                                  HoodieLogFile logFile,
-                                 HoodieReaderContext<?> readerContext,
-                                 HoodieSchema deleteLogSchema,
                                  List<String> orderingFieldNames,
+                                 String partitionPath,
+                                 Properties props,
                                  Map<HeaderMetadataType, String> header,
                                  Map<FooterMetadataType, String> footer) {
     super(Option.empty(), null, true, getContentLocation(storage, logFile), 
header, footer);
     this.storage = storage;
     this.logFile = logFile;
-    this.readerContext = readerContext;
-    this.deleteLogSchema = deleteLogSchema;
+    this.deleteLogSchema = 
HoodieSchemas.createDeleteLogSchema(getSchemaFromHeader(), orderingFieldNames);
     this.orderingFieldNames = orderingFieldNames;
+    this.partitionPath = partitionPath;
+    this.props = props == null ? new Properties() : props;
   }
 
   @Override
   public DeleteRecord[] getRecordsToDelete() {
-    throw new HoodieNotSupportedException("Native delete log files do not 
support the legacy DeleteRecord[] API. "
-        + "Use getRecordsToDelete(RecordContext) instead. Log file: " + 
logFile);
+    if (recordsToDelete == null) {
+      recordsToDelete = readRecordsToDelete();

Review Comment:
   why read as delete record from native delete logs



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