You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: unify ColumnSource::Add and AddStructConstant using Literal #2699
AddStructConstant was added in #2668 for the _partition metadata column because Add only supports primitive values. However, iceberg-rust already has Literal::Struct in crates/iceberg/src/spec/values/literal.rs which can represent struct values natively.
Proposed refactoring
Change ColumnSource::Add to use Option instead of Option:
Add {
target_type: DataType,
value: Option,
},
Remove ColumnSource::AddStructConstant — struct constants become a Literal::Struct inside Add.
Update create_column (and create_struct_column) to handle Literal::Struct by recursively constructing child arrays, similar to how AddStructConstant works today.
This also opens the door for constant_fields: HashMap<i32, Datum> to eventually support struct-valued constants (e.g., if Datum gains a struct variant), which would allow the _partition column to use the same constant_fields path as _file and identity-partitioned columns.
Benefits
Eliminates a special-case enum variant
Aligns the constant-column infrastructure with iceberg-rust's existing Literal type system
Makes future metadata columns or complex-typed constants straightforward to add
Activity
parthchandra commentedon Jul 2, 2026
Link to @mbutrovich 's comment - https://github.com/apache/iceberg-rust/pull/2668/changes#r3500865509