-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix reading multiple complex data types exception #140
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for raising this. CI failures look unrelated, should be fixed by #141 so just need to pull from main.
Could you also include a short explanation for this fix, to help me understand how it fixes the issue?
let mut projection = Vec::with_capacity(projected_schema.fields().len()); | ||
for named_column in builder.file_metadata().root_data_type().children() { | ||
if let Some((_table_idx, _table_field)) = | ||
projected_schema.fields().find(named_column.name()) | ||
{ | ||
projection.push(named_column.data_type().column_index()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let mut projection = Vec::with_capacity(projected_schema.fields().len()); | |
for named_column in builder.file_metadata().root_data_type().children() { | |
if let Some((_table_idx, _table_field)) = | |
projected_schema.fields().find(named_column.name()) | |
{ | |
projection.push(named_column.data_type().column_index()); | |
} | |
} | |
let projection = builder | |
.file_metadata() | |
.root_data_type() | |
.children() | |
.iter() | |
.filter(|named_column| { | |
projected_schema | |
.fields() | |
.find(named_column.name()) | |
.is_some() | |
}) | |
.map(|named_column| named_column.data_type().column_index()); |
Thoughts on using a more iterator based approach? Could potentially be simplified further.
Fix #139