TheR1sing3un commented on code in PR #13593:
URL: https://github.com/apache/hudi/pull/13593#discussion_r2224199598
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieFileIndex.scala:
##########
@@ -172,15 +172,22 @@ case class HoodieFileIndex(spark: SparkSession,
* @return list of PartitionDirectory containing partition to base files
mapping
*/
override def listFiles(partitionFilters: Seq[Expression], dataFilters:
Seq[Expression]): Seq[PartitionDirectory] = {
- val prunedPartitionsAndFilteredFileSlices = filterFileSlices(dataFilters,
partitionFilters).flatMap(
+ val slices = filterFileSlices(dataFilters, partitionFilters).flatMap(
{ case (partitionOpt, fileSlices) =>
- fileSlices.filter(!_.isEmpty).map(fs => (partitionOpt, fs))
+ fileSlices.filter(!_.isEmpty).map(fs => (
InternalRow.fromSeq(partitionOpt.get.values), fs))
}
- ).map {
- case (partitionOpt, fileSlice) =>
+ )
+ prepareFileSlices(slices)
+ }
+
+ protected def prepareFileSlices(slices: Seq[(InternalRow, FileSlice)]):
Seq[PartitionDirectory] = {
+ hasPushedDownPartitionPredicates = true
Review Comment:
`hasPushedDownPartitionPredicates` should mainly be to indicate that a
'listFiles' operation has been performed. It seems more reasonable to place it
in the' listFiles' method. 'prepareFileSlices' should just be a tool method
--
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]