rahil-c commented on code in PR #13591:
URL: https://github.com/apache/hudi/pull/13591#discussion_r2226630154


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/HoodieFileGroupReaderBasedParquetFileFormat.scala:
##########
@@ -217,6 +218,7 @@ class 
HoodieFileGroupReaderBasedParquetFileFormat(tablePath: String,
                 .withStart(file.start)
                 .withLength(baseFileLength)
                 .withShouldUseRecordPosition(shouldUseRecordPosition)
+                
.withEnableOptimizedLogBlockScan(props.getBoolean(HoodieReaderConfig.ENABLE_OPTIMIZED_LOG_BLOCKS_SCAN.key(),
 HoodieReaderConfig.ENABLE_OPTIMIZED_LOG_BLOCKS_SCAN.defaultValue().toBoolean))

Review Comment:
   Thanks @danny0405 for the review
   
   However I do not think this is always guaranteed that the `props` will 
contain this key, here is an example where props will be getting the key value 
pairs from `tableConfig` instead of the `writeConfig` or `metadataConfig`. 
https://github.com/apache/hudi/pull/13591/files#diff-4a56c253bd614502fe042fe392e13a0f92072cc96e4757647b886f80aadbd422R294
   
   Therefore if we did do the fallback fetch props logic in builder, I think 
the value of `enableOptimizedLogBlockScan` could be incorrectly overwritten.
    
   The field `enableOptimizedLogBlockScan` is a boolean that seems to be set in 
the builder to  
   `private boolean enableOptimizedLogBlockScan = false`, so we can not check 
for it being `null`.
   
    If we do the check to see if its `false` this could be intentionally have 
been set by the user in places where we have access to the 
`HoodieMetadataConfig` or the `HoodieReaderConfig` and pass it in via 
`.withEnableOptimizedLogBlockScan(config.enableOptimizedLogBlocksScan())` like 
here 
https://github.com/apache/hudi/pull/13591/files#diff-4a56c253bd614502fe042fe392e13a0f92072cc96e4757647b886f80aadbd422R295
   
   



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