linliu-code commented on code in PR #9593:
URL: https://github.com/apache/hudi/pull/9593#discussion_r1341598664


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieCreateHandle.java:
##########
@@ -139,23 +140,34 @@ protected void doWrite(HoodieRecord record, Schema 
schema, TypedProperties props
           return;
         }
 
-        MetadataValues metadataValues = new 
MetadataValues().setFileName(path.getName());
-        HoodieRecord populatedRecord =
-            record.prependMetaFields(schema, writeSchemaWithMetaFields, 
metadataValues, config.getProps());
-
-        if (preserveMetadata) {
-          fileWriter.write(record.getRecordKey(), populatedRecord, 
writeSchemaWithMetaFields);
-        } else {
-          fileWriter.writeWithMetadata(record.getKey(), populatedRecord, 
writeSchemaWithMetaFields);
+        // Inject custom logic for the record.
+        Option<Pair<HoodieRecord, Schema>> processedRecord = 
config.getRecordMerger().insert(record, schema, config.getProps());
+        if (!processedRecord.isPresent()
+            || 
HoodieOperation.isDelete(processedRecord.get().getLeft().getOperation())

Review Comment:
   Should we allow the custom logic?



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