ZENOTME commented on code in PR #1362:
URL: https://github.com/apache/iceberg-rust/pull/1362#discussion_r2140562075


##########
crates/iceberg/src/spec/table_metadata.rs:
##########
@@ -121,20 +124,23 @@ pub struct TableMetadata {
     /// An integer; the highest assigned column ID for the table.
     pub(crate) last_column_id: i32,
     /// A list of schemas, stored as objects with schema-id.
+    #[builder(setter(transform = |schemas: Vec<SchemaRef>| 
schemas.into_iter().map(|s| (s.schema_id(), s)).collect()))]
     pub(crate) schemas: HashMap<i32, SchemaRef>,
     /// ID of the table’s current schema.
     pub(crate) current_schema_id: i32,
     /// A list of partition specs, stored as full partition spec objects.
+    #[builder(setter(transform = |specs: Vec<PartitionSpecRef>| 
specs.into_iter().map(|s| (s.spec_id(), s)).collect()))]
     pub(crate) partition_specs: HashMap<i32, PartitionSpecRef>,
     /// ID of the “current” spec that writers should use by default.
+    #[builder(setter(into))]
     pub(crate) default_spec: PartitionSpecRef,
     /// Partition type of the default partition spec.
     pub(crate) default_partition_type: StructType,
     /// An integer; the highest assigned partition field ID across all 
partition specs for the table.
     pub(crate) last_partition_id: i32,
     ///A string to string map of table properties. This is used to control 
settings that
     /// affect reading and writing and is not intended to be used for 
arbitrary metadata.
-    /// For example, commit.retry.num-retries is used to control the number of 
commit retries.
+    /// For example, commit.retry.num-retries is used to control the number of 
commit retries

Review Comment:
   nit: unnecessary change?



##########
crates/iceberg/src/spec/table_metadata.rs:
##########
@@ -654,6 +670,33 @@ impl TableMetadata {
     }
 }
 
+/// Unnormalized table metadata, used as an intermediate type
+/// to build table metadata in a declarative way.
+#[derive(Debug, PartialEq, Deserialize, Eq, Clone)]
+pub struct UnnormalizedTableMetadata(TableMetadata);

Review Comment:
   I don't get why we need this. Why not build TableMeadata from a declarative 
builder directly?🤔



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