liurenjie1024 commented on code in PR #1116:
URL: https://github.com/apache/iceberg-rust/pull/1116#discussion_r2004663889


##########
crates/iceberg/src/spec/name_mapping.rs:
##########
@@ -20,10 +20,14 @@
 use serde::{Deserialize, Serialize};
 use serde_with::{serde_as, DefaultOnNull};
 
+/// Property name for name mapping.
+pub const DEFAULT_SCHEMA_NAME_MAPPING: &str = "schema.name-mapping.default";
+
 /// Iceberg fallback field name to ID mapping.
 #[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
 #[serde(transparent)]
 pub struct NameMapping {
+    /// The fields which are to be mapped from name to field ID.

Review Comment:
   Given we are exporting it in public interface, I would suggest to make 
fields `private` and expose methods only.



##########
crates/iceberg/src/spec/name_mapping.rs:
##########
@@ -20,10 +20,14 @@
 use serde::{Deserialize, Serialize};
 use serde_with::{serde_as, DefaultOnNull};
 
+/// Property name for name mapping.
+pub const DEFAULT_SCHEMA_NAME_MAPPING: &str = "schema.name-mapping.default";
+
 /// Iceberg fallback field name to ID mapping.
 #[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
 #[serde(transparent)]
 pub struct NameMapping {
+    /// The fields which are to be mapped from name to field ID.

Review Comment:
   Applies to other sturcts.



##########
crates/iceberg/src/spec/name_mapping.rs:
##########
@@ -32,9 +36,12 @@ pub struct NameMapping {
 #[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
 #[serde(rename_all = "kebab-case")]
 pub struct MappedField {
+    /// Iceberg field ID when a field's name is present within `names`.

Review Comment:
   I'm thinking that we should add a 
[MappingFields](https://github.com/apache/iceberg/blob/c07f2aabc0a1d02f068ecf1514d2479c0fbdd3b0/core/src/main/java/org/apache/iceberg/mapping/MappedFields.java#L29)
 like what we did in java. `MappingFields` is a list of fields with index. 



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

Reply via email to