comphead commented on code in PR #3269:
URL: https://github.com/apache/iceberg-rust/pull/3269#discussion_r4232334192
##########
crates/iceberg/src/arrow/reader/projection.rs:
##########
@@ -422,6 +422,16 @@ pub(super) fn apply_name_mapping_to_arrow_schema(
"Schema already has field IDs - name mapping should not be applied"
);
+ let mut field_ids_by_name = HashMap::new();
Review Comment:
Nit: this map is rebuilt for every file and costs `O(mapped names)` hashing
and allocation up front, whereas the old scan cost `O(arrow fields × mapped
fields)` with early exit. For a file with a handful of columns against a very
wide table mapping, the index may not win. I have not measured that case, so
treat it as a question. If you keep the index,
`HashMap::with_capacity(name_mapping.fields().len())` avoids rehash growth
while it fills.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]