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:
   So more concretely something like this in the `public 
HoodieFileGroupReader<T> build()` ?
   
   ```
   this.enableOptimizedLogBlockScan = 
props.getBoolean(HoodieReaderConfig.ENABLE_OPTIMIZED_LOG_BLOCKS_SCAN.key(),
              
Boolean.parseBoolean(HoodieReaderConfig.ENABLE_OPTIMIZED_LOG_BLOCKS_SCAN.defaultValue()));
   
   return new HoodieFileGroupReader<>(
             readerContext, storage, tablePath, latestCommitTime, dataSchema, 
requestedSchema, internalSchemaOpt, hoodieTableMetaClient,
             props, shouldUseRecordPosition, allowInflightInstants, emitDelete, 
sortOutput, inputSplit, fileGroupUpdateCallback, enableOptimizedLogBlockScan);
   ```
   
   I do not think we need the `if` condition even, as when checking the impl of 
`props.getBoolean` it will check first for the existence of the key and get 
that value. 
   
   ```
   public boolean getBoolean(String property, boolean defaultValue) {
       return containsKey(property) ? 
Boolean.parseBoolean(getProperty(property)) : defaultValue;
     }
   ```
   
   If it does not find then it will use the default value.



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