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


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieIncrementalFileIndex.scala:
##########
@@ -69,6 +69,20 @@ class HoodieIncrementalFileIndex(override val spark: 
SparkSession,
     }).map(fileStatus => fileStatus.getPath.toString).toArray
   }
 
+  private val reportMaxFileSize: Boolean = options.getOrElse(
+    DataSourceReadOptions.INCREMENTAL_REPORT_MAX_FILE_SIZE.key,
+    
DataSourceReadOptions.INCREMENTAL_REPORT_MAX_FILE_SIZE.defaultValue.toString
+  ).toBoolean
+
+  override def sizeInBytes: Long = {
+    if (reportMaxFileSize) {
+      Long.MaxValue

Review Comment:
   Should this use `sqlContext.conf.defaultSizeInBytes,` which is the default 
of `BaseRelation.sizeInBytes`?



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/DataSourceOptions.scala:
##########
@@ -181,6 +181,20 @@ object DataSourceReadOptions {
     .withDocumentation("Whether to skip clustering instants to avoid reading 
base files of clustering operations "
       + "for streaming read to improve read performance.")
 
+  val INCREMENTAL_REPORT_MAX_FILE_SIZE: ConfigProperty[Boolean] = 
ConfigProperty
+    .key("hoodie.datasource.read.incr.reportMaxFileSize")

Review Comment:
   Is `hoodie.datasource.read.incr.size.estimation.enable` a better name (to 
avoid camelCase), with default to `false`? The current naming suggests using 
the maximum file size, which is different from what it actually is?



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieIncrementalFileIndex.scala:
##########
@@ -69,6 +69,20 @@ class HoodieIncrementalFileIndex(override val spark: 
SparkSession,
     }).map(fileStatus => fileStatus.getPath.toString).toArray
   }
 
+  private val reportMaxFileSize: Boolean = options.getOrElse(
+    DataSourceReadOptions.INCREMENTAL_REPORT_MAX_FILE_SIZE.key,
+    
DataSourceReadOptions.INCREMENTAL_REPORT_MAX_FILE_SIZE.defaultValue.toString
+  ).toBoolean

Review Comment:
   nit: use `SparkConfigUtils.getStringWithAltKeys` to avoid `.key` reference



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