jonathanc-n commented on code in PR #1299: URL: https://github.com/apache/iceberg-rust/pull/1299#discussion_r2082404424
########## crates/iceberg/src/spec/name_mapping/mod.rs: ########## @@ -79,15 +120,188 @@ impl MappedField { } /// Get a reference to the field mapping for any child fields. - pub fn fields(&self) -> &[Arc<MappedField>] { + pub fn fields(&self) -> &[MappedField] { &self.fields } } +/// A trait for visiting and transforming a name mapping +trait NameMappingVisitor { + /// Aggregated result of `MappedField`s + type S; + /// Result type for processing one `MappedField` + type T; + + /// Handles entire `NameMapping` field + fn mapping(&self, field_result: Self::S) -> Self::S; + + /// Handles accessing multiple `MappedField` + fn fields(&self, field_results: Vec<Self::T>) -> Self::S; Review Comment: Sorry, what the function does is misleading. the fields function takes all the field maps from that level and combines them into one map. I will change the comment. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org