You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/09 15:31:41 UTC

[GitHub] [arrow-rs] jackwener commented on a change in pull request #1339: Implement projection for arrow file / streams

jackwener commented on a change in pull request #1339:
URL: https://github.com/apache/arrow-rs/pull/1339#discussion_r822773419



##########
File path: arrow/src/ipc/reader.rs
##########
@@ -672,6 +697,18 @@ impl<R: Read + Seek> FileReader<R> {
             };
         }
 
+        let projection = projection.map(|projection| {
+            let fields = projection
+                .iter()
+                .map(|x| schema.fields[*x].clone())
+                .collect();
+            let schema = Schema {
+                fields,
+                metadata: schema.metadata.clone(),
+            };

Review comment:
       ```suggestion
             // like this
             let schema = schema.project(&projection.to_vec());
   ```




-- 
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-unsubscribe@arrow.apache.org

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