File tree Expand file tree Collapse file tree
crates/iceberg/src/transaction Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ pub struct AddColumn {
4848 #[ builder( default = false ) ]
4949 required : bool ,
5050 field_type : Type ,
51+ #[ builder( default = None ) ]
52+ id : Option < i32 > ,
5153 #[ builder( default = None , setter( strip_option, into) ) ]
5254 doc : Option < String > ,
5355 #[ builder( default = None , setter( strip_option) ) ]
@@ -91,7 +93,7 @@ impl AddColumn {
9193
9294 fn to_nested_field ( & self ) -> NestedFieldRef {
9395 let mut field = NestedField :: new (
94- DEFAULT_ID ,
96+ self . id . unwrap_or ( DEFAULT_ID ) ,
9597 self . name . clone ( ) ,
9698 self . field_type . clone ( ) ,
9799 self . required ,
@@ -457,7 +459,7 @@ impl TransactionAction for UpdateSchemaAction {
457459 } ;
458460
459461 // Assign fresh IDs immediately, preserving insertion order.
460- let field = if self . auto_assign_ids {
462+ let field = if self . auto_assign_ids && pending_field . id == DEFAULT_ID {
461463 assign_fresh_ids ( & pending_field, & mut last_column_id)
462464 } else {
463465 pending_field
You can’t perform that action at this time.
0 commit comments