hudi-agent commented on code in PR #19283:
URL: https://github.com/apache/hudi/pull/19283#discussion_r3586931920


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/FileGroupReaderBasedInlineLogAppendHandle.java:
##########
@@ -69,6 +69,10 @@ public 
FileGroupReaderBasedInlineLogAppendHandle(HoodieWriteConfig config, Strin
     super(config, instantTime, hoodieTable, operation.getPartitionPath(), 
operation.getFileId(), taskContextSupplier);
     this.operation = operation;
     this.readerContext = readerContext;
+    // File-group reader output already conforms to the writer schema. 
Preserve its metadata fields
+    // instead of prepending another metadata overlay and shifting the 
data-field ordinals.
+    this.isLogCompaction = true;

Review Comment:
   🤖 nit: setting `isLogCompaction = true` in a class that isn't doing log 
compaction is a bit surprising — a future reader will wonder why this append 
handle claims to be a log-compaction handle. The comment explains the *effect* 
you want (don't prepend a metadata overlay), but the flag name doesn't express 
that intent. Could the parent handle expose a more descriptive flag or hook 
(e.g. `skipMetaFieldOverlay`) so the two FileGroupReader-based handles can opt 
in without borrowing a semantically unrelated flag?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/FileGroupReaderBasedNativeLogAppendHandle.java:
##########
@@ -65,6 +65,10 @@ public 
FileGroupReaderBasedNativeLogAppendHandle(HoodieWriteConfig config, Strin
     super(config, instantTime, hoodieTable, operation.getPartitionPath(), 
operation.getFileId(), taskContextSupplier);
     this.operation = operation;
     this.readerContext = readerContext;
+    // File-group reader output is materialized with the writer schema, 
including Hudi meta fields.
+    // Treating it as a regular append would prepend another meta-field 
overlay and shift all data ordinals.
+    this.isLogCompaction = true;

Review Comment:
   🤖 nit: same `isLogCompaction = true` proxy as in the inline counterpart — 
worth addressing both together if the parent can expose a cleaner hook for 
"data already carries writer schema + meta fields, skip the overlay."
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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