jayzhan211 commented on code in PR #15379:
URL: https://github.com/apache/datafusion/pull/15379#discussion_r2010073554


##########
datafusion/core/src/datasource/statistics.rs:
##########
@@ -39,8 +39,8 @@ pub async fn get_statistics_with_limit(
     file_schema: SchemaRef,
     limit: Option<usize>,
     collect_stats: bool,
-) -> Result<(Vec<PartitionedFile>, Statistics)> {
-    let mut result_files = vec![];
+) -> Result<(FileGroup, Statistics)> {
+    let mut result_files = FileGroup::default();

Review Comment:
   What are the difference between the `statistics` in `FileGroup` and the 
returned value here? Do we need `statistics` in FileGroup, if so, could we add 
the returned `Statistics` inside `FileGroup`?



##########
datafusion/datasource/src/file_stream.rs:
##########
@@ -91,7 +91,7 @@ impl FileStream {
         let files = config.file_groups[partition].clone();
 
         Ok(Self {
-            file_iter: files.into(),
+            file_iter: files.iter().cloned().collect(),

Review Comment:
   let file_group = config.file_groups[partition].clone();
   
   use `file_group.files.into_iter().collect()` to avoid clone



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