Dandandan commented on a change in pull request #1339:
URL: https://github.com/apache/arrow-rs/pull/1339#discussion_r822867367
##########
File path: arrow/src/ipc/reader.rs
##########
@@ -845,11 +888,23 @@ impl<R: Read> StreamReader<R> {
// Create an array of optional dictionary value arrays, one per field.
let dictionaries_by_field = vec![None; schema.fields().len()];
+ let projection = projection.map(|projection| {
+ let fields = projection
+ .iter()
+ .map(|x| schema.fields[*x].clone())
+ .collect();
+ let schema = Schema {
+ fields,
+ metadata: schema.metadata.clone(),
+ };
+ (projection, schema)
+ });
Review comment:
Thanks, did it a bit different.
--
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]