hudi-agent commented on code in PR #19992:
URL: https://github.com/apache/hudi/pull/19992#discussion_r4056061660


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/source/FileIndex.java:
##########
@@ -197,8 +198,16 @@ public List<FileSlice> filterFileSlices(List<FileSlice> 
fileSlices) {
     }
 
     // data skipping based on column stats
+    if (colStatsProbe == null || filteredFileSlices.isEmpty()) {
+      return filteredFileSlices;
+    }
+    List<String> candidatePartitions = 
filteredFileSlices.stream().map(FileSlice::getPartitionPath).distinct().collect(Collectors.toList());
+    // Avoid expanding column prefixes when the remaining files still span 
every partition.
+    if (candidatePartitions.size() == totalPartitionCount) {
+      candidatePartitions = Collections.emptyList();

Review Comment:
   🤖 nit: using an empty list to mean "all partitions" is a bit of a hidden 
sentinel here — have you considered a small named constant (e.g. 
`ALL_PARTITIONS = Collections.emptyList()`) or a short comment on this line so 
readers don't mistake it for "no partitions"?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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