xudong963 commented on code in PR #16014:
URL: https://github.com/apache/datafusion/pull/16014#discussion_r2084310310


##########
datafusion/datasource-parquet/src/opener.rs:
##########
@@ -85,7 +86,49 @@ pub(super) struct ParquetOpener {
 }
 
 impl FileOpener for ParquetOpener {
-    fn open(&self, file_meta: FileMeta) -> Result<FileOpenFuture> {
+    fn open(&self, file_meta: FileMeta, file: PartitionedFile) -> 
Result<FileOpenFuture> {
+        let predicate_creation_errors = MetricBuilder::new(&self.metrics)
+            .global_counter("num_predicate_creation_errors");
+        // Prune using known statistics
+        match (&file.statistics, &self.predicate) {
+            (Some(stats), Some(predicate)) => {

Review Comment:
   Given that there is only one branch, I suggest using `if let (Some(_), 
Some(_)) = xxx {}` here.



##########
datafusion/datasource-parquet/src/opener.rs:
##########
@@ -85,7 +86,49 @@ pub(super) struct ParquetOpener {
 }
 
 impl FileOpener for ParquetOpener {
-    fn open(&self, file_meta: FileMeta) -> Result<FileOpenFuture> {
+    fn open(&self, file_meta: FileMeta, file: PartitionedFile) -> 
Result<FileOpenFuture> {
+        let predicate_creation_errors = MetricBuilder::new(&self.metrics)
+            .global_counter("num_predicate_creation_errors");
+        // Prune using known statistics
+        match (&file.statistics, &self.predicate) {
+            (Some(stats), Some(predicate)) => {
+                let pruning_predicate = build_pruning_predicate(
+                    Arc::clone(predicate),
+                    &self.table_schema,

Review Comment:
   Should it use `table_schema` here? 



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to