Fokko commented on code in PR #615:
URL: https://github.com/apache/iceberg-rust/pull/615#discussion_r1749313279


##########
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:
   Typically you would pass in `last-column-id` from the table metadata. In the 
case of a `CREATE TABLE` this will be zero, in the case of a `REPLACE TABLE` it 
will be `last-column-id` where all columns get a new ID and you ensure they are 
not used before.



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