liurenjie1024 commented on code in PR #1116: URL: https://github.com/apache/iceberg-rust/pull/1116#discussion_r2031239672
########## crates/iceberg/src/spec/name_mapping.rs: ########## @@ -33,12 +48,38 @@ pub struct NameMapping { #[serde(rename_all = "kebab-case")] pub struct MappedField { #[serde(skip_serializing_if = "Option::is_none")] - pub field_id: Option<i32>, - pub names: Vec<String>, + field_id: Option<i32>, + names: Vec<String>, #[serde(default)] #[serde(skip_serializing_if = "Vec::is_empty")] #[serde_as(deserialize_as = "DefaultOnNull")] - pub fields: Vec<MappedField>, + fields: Vec<MappedField>, Review Comment: Seems `#[serde(transparent)]` doesn't work here. I think then maybe we should remove `MappedFields` struct and put everything in `NamedMapping`, just like what we do in pyiceberg. This maybe be harmful as this interface is not critical. Another approach is to have a standalone module for ser/de, just like what we did in other core data structures like [TableMetadata](https://github.com/apache/iceberg-rust/blob/fcc88920f52dbae53257757e2d33825bea4b51a9/crates/iceberg/src/spec/table_metadata.rs#L625) But this may not deserve such complexity. -- 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