xudong963 commented on code in PR #15503: URL: https://github.com/apache/datafusion/pull/15503#discussion_r2030678262
########## datafusion/datasource/src/source.rs: ########## @@ -175,6 +175,23 @@ impl ExecutionPlan for DataSourceExec { self.data_source.statistics() } + fn statistics_by_partition(&self) -> datafusion_common::Result<Vec<Statistics>> { + let mut statistics = vec![ + Statistics::new_unknown(&self.schema()); + self.properties().partitioning.partition_count() + ]; + if let Some(file_config) = + self.data_source.as_any().downcast_ref::<FileScanConfig>() + { + for (idx, file_group) in file_config.file_groups.iter().enumerate() { + if let Some(stat) = file_group.statistics() { + statistics[idx] = stat.clone(); Review Comment: Yes, at least we can use `Arc` now. I've done a pre PR to add Arc for the statistics `FileGroup` https://github.com/apache/datafusion/pull/15564 -- 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