rgbuilds commented on code in PR #26441:
URL: https://github.com/apache/datafusion/pull/26441#discussion_r4507639145


##########
datafusion/catalog-listing/src/table.rs:
##########
@@ -1270,6 +1345,34 @@ async fn get_files_with_limit(
     Ok((file_group, inexact_stats))
 }
 
+/// Keep a file unless the pruning predicate proves it cannot contain a match.
+fn prune_collected_files(
+    predicate: &datafusion_pruning::PruningPredicate,
+    file_schema: &SchemaRef,
+    files: FileGroup,
+) -> FileGroup {
+    FileGroup::new(
+        files
+            .into_inner()
+            .into_iter()
+            .filter(|file| {
+                let Some(statistics) = &file.statistics else {
+                    return true;
+                };

Review Comment:
   @jayzhan211 Addressed. Files without usable statistics now return early via 
`file.has_statistics()`, avoiding unnecessary `PrunableStatistics` construction 
and pruning calls.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to