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:
   I think i generally agree that as long as this property has been propagated 
correctly to the `private TypedProperties props` then we do the fallback logic.
   
   So more concretely something im thinking something like this in `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.



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieMergeOnReadRDDV2.scala:
##########
@@ -142,6 +142,9 @@ class HoodieMergeOnReadRDDV2(@transient sc: SparkContext,
         val properties = TypedProperties.fromMap(options.asJava)
         properties.setProperty(MAX_MEMORY_FOR_MERGE.key(), 
String.valueOf(maxCompactionMemoryInBytes))
         properties.setProperty(HoodieReaderConfig.MERGE_TYPE.key(), mergeType)
+        if 
(!properties.containsKey(HoodieReaderConfig.ENABLE_OPTIMIZED_LOG_BLOCKS_SCAN.key()))
 {
+          
properties.put(HoodieReaderConfig.ENABLE_OPTIMIZED_LOG_BLOCKS_SCAN.key(), 
HoodieReaderConfig.ENABLE_OPTIMIZED_LOG_BLOCKS_SCAN.defaultValue())

Review Comment:
   will remove this line.



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