cshuo commented on code in PR #20366:
URL: https://github.com/apache/hudi/pull/20366#discussion_r4292580329


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/FileGroupReaderBasedInlineLogAppendHandle.java:
##########
@@ -103,7 +104,7 @@ public void doAppend() {
         // instead of using config.enableOptimizedLogBlocksScan(), we set to 
true as log compaction blocks only supported in scanV2
         .build()) {
       recordItr = new 
CloseableMappingIterator<>(fileGroupReader.getLogRecordsOnly(), record -> {
-        HoodieRecord<T> hoodieRecord = 
readerContext.getRecordContext().constructHoodieRecord(record);
+        HoodieRecord<T> hoodieRecord = 
readerContext.getRecordContext().constructHoodieRecord(withJavaOrderingValue(record));

Review Comment:
   **Move the conversion to the `HoodieEmptyRecord` construction boundary**
   
   `HoodieInlineLogAppendHandle.writeDelete()` already calls 
`HoodieRecord.getOrderingValueAsJava()`, so the append handle should not need 
to convert ordering values before constructing records.
   
   The missing conversion is in the creation of `HoodieEmptyRecord`: it is 
engine-agnostic, and its `getOrderingValueAsJava()` returns the stored ordering 
value unchanged. Please convert the ordering value in the `HoodieEmptyRecord` 
branch of `RecordContext.constructHoodieRecord()`. This covers all callers 
constructing empty records and preserves engine-typed ordering values for 
engine-specific records.



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