codope commented on code in PR #10009:
URL: https://github.com/apache/hudi/pull/10009#discussion_r1386050749
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieIncrementalFileIndex.scala:
##########
@@ -36,9 +36,10 @@ class HoodieIncrementalFileIndex(override val spark:
SparkSession,
override val schemaSpec: Option[StructType],
override val options: Map[String, String],
@transient override val fileStatusCache:
FileStatusCache = NoopCache,
- override val includeLogFiles: Boolean)
+ override val includeLogFiles: Boolean,
+ override val shouldEmbedFileSlices: Boolean)
Review Comment:
do we have some bootstrap tests covering the path w/ and w/o
`shouldEmbedFileSlices`?
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieIncrementalFileIndex.scala:
##########
@@ -47,52 +48,52 @@ class HoodieIncrementalFileIndex(override val spark:
SparkSession,
val fileSlices =
mergeOnReadIncrementalRelation.listFileSplits(partitionFilters, dataFilters)
if (fileSlices.isEmpty) {
Seq.empty
- }
-
- val prunedPartitionsAndFilteredFileSlices = fileSlices.map {
- case (partitionValues, fileSlices) =>
- if (shouldEmbedFileSlices) {
- val baseFileStatusesAndLogFileOnly: Seq[FileStatus] =
fileSlices.map(slice => {
- if (slice.getBaseFile.isPresent) {
- slice.getBaseFile.get().getFileStatus
- } else if (slice.getLogFiles.findAny().isPresent) {
- slice.getLogFiles.findAny().get().getFileStatus
+ } else {
+ val prunedPartitionsAndFilteredFileSlices = fileSlices.map {
+ case (partitionValues, fileSlices) =>
+ if (shouldEmbedFileSlices) {
Review Comment:
I see some opportunity to reuse code here and in `HoodieFileIndex.listFiles`.
--
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]