c-thiel commented on code in PR #615:
URL: https://github.com/apache/iceberg-rust/pull/615#discussion_r1749940779


##########
crates/iceberg/src/spec/schema.rs:
##########
@@ -86,6 +87,16 @@ impl SchemaBuilder {
         self
     }
 
+    /// Reassign all field-ids (nested) on build.
+    /// If `start_from` is provided, it will start reassigning from that id 
(inclusive).
+    /// If not provided, it will start from 0.
+    ///
+    /// All specified aliases and identifier fields will be updated to the new 
field-ids.
+    pub fn with_reassigned_field_ids(mut self, start_from: Option<i32>) -> 
Self {
+        self.reassign_field_ids_from = Some(start_from.unwrap_or(0));

Review Comment:
   @Xuanwo only doubt with the i32 is that people might input 1 as something is 
required - and it's shorter than Default::default().
   The rust tests are quite a good example that this can happen: We have many 
tests where field numbering starts from 1, so I had to re-write them to be 
compatible with the new builder.
   
   I am OK with the i32 as well, just wanted to bring up that a None is 
probably more verbose.



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