yihua commented on code in PR #13444:
URL: https://github.com/apache/hudi/pull/13444#discussion_r2217344810


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/FileGroupReaderBasedAppendHandle.java:
##########
@@ -77,9 +79,11 @@ public void doAppend() {
     props.put(HoodieMemoryConfig.MAX_MEMORY_FOR_MERGE.key(), 
String.valueOf(maxMemoryPerCompaction));
     // Initializes the record iterator
     try (HoodieFileGroupReader<T> fileGroupReader = 
HoodieFileGroupReader.<T>newBuilder().withReaderContext(readerContext).withHoodieTableMetaClient(hoodieTable.getMetaClient())
-        
.withLatestCommitTime(instantTime).withFileSlice(fileSlice).withDataSchema(writeSchemaWithMetaFields).withRequestedSchema(writeSchemaWithMetaFields)
+        
.withLatestCommitTime(instantTime).withFileSlice(fileSlice).withDataSchema(writeSchemaWithMetaFields).withRequestedSchema(writeSchemaWithMetaFields).withEnableOptimizedLogBlockScan(true)
         
.withInternalSchema(internalSchemaOption).withProps(props).withShouldUseRecordPosition(usePosition).withSortOutput(hoodieTable.requireSortedRecords()).build())
 {
       recordItr = fileGroupReader.getClosableHoodieRecordIterator();
+      header.put(HoodieLogBlock.HeaderMetadataType.COMPACTED_BLOCK_TIMES,
+          StringUtils.join(fileGroupReader.getValidBlockInstants(), ","));

Review Comment:
   Is there any test coverage around this?  Seems that the log comapction tests 
pass without the change.  We can add validation on the log header to make sure 
`COMPACTED_BLOCK_TIMES` is added, in an existing log compaction test.



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