CTTY commented on code in PR #3540:
URL: https://github.com/apache/iceberg-rust/pull/3540#discussion_r4595741376


##########
crates/iceberg/src/arrow/reader/row_filter.rs:
##########
@@ -220,6 +239,33 @@ impl ArrowReader {
     }
 }
 
+/// The top-level fields holding `leaf_ids`, pruned to those leaves, and their 
ids in leaf order
+/// (the filter batch's column order). Only these fields are converted, so the 
transformer's
+/// per-file setup does not grow with the table's width.
+fn filter_schema(snapshot_schema: &Schema, leaf_ids: &[i32]) -> 
Result<(Schema, Vec<i32>)> {
+    let mut roots: Vec<NestedFieldRef> = Vec::with_capacity(leaf_ids.len());
+    for accessor in leaf_ids
+        .iter()
+        .filter_map(|id| snapshot_schema.accessor_by_field_id(*id))

Review Comment:
   We should fail here if the leaf id is not found in the current table schema, 
filter_map would pass silently on unfound fields



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

Reply via email to