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
Support for write default and initial default #3250
We should support these defaults, implementing correct spec behavior. This includes validating that defaults cannot be set on fields that don't support it (geospatial types, Unknown type, Variant type).
Describe the solution you'd like
I see that a bunch of the implementation is already done. That being said, I don't see validation. For instance, I don't see a way to disallow geospatial defaults.
I'd like to see an audit of the implementation in iceberg-rust today, such that we have a place to reference that this work has been completed in full.
I see a bunch of this is already implemented, this is to track how much is actually implemented and what gaps remain, such that we can call V3 complete, tested, and spec compliant. Thanks all!
Edit to document what I've found so far (2025-10-02):
Serde is done
We validate schema evolution to check required columns specify defaults
We appear to populate initial default only for projected primitive types, not complex types
We DO NOT populate write defaults (I don't think there's a nice way to allow nulls in the Arrow batches written for a required column yet)
We do not perform any validation on the defaults content
We need some strengthening of the validation on the values when constructing NestedField values. API: Add fallible NestedField builder #3190 refactors this area of the code to facilitate this.
iceberg-java does not appear to fully implement the spec. When gating what defaults we allow, we may want to be more conservative as iceberg-rust spec-compliant schema evolutions could be entirely unreadable by Java.
I'd like to take ownership of this one, I've been prototyping it a bunch. However if anyone would really like to take it, ping me, I don't want to block this.
FYI @blackmwk@CTTY. I plan to have a lot of the validation evaluated late for default values rather than at construction. In other words, we can load the table with a bad default just fine but only on read or write might it fail.
The reason for this being that tables with bad defaults may otherwise be working for the use case: projecting columns that don't have bad defaults, writing to files where the column is always provided so default is never needed, etc..
I'm raising this as this feels to be heading in the opposite direction of other changes, like validating construction of types allowing them only to be constructed or deserialized if they are valid. I'm wondering what your take is here.
Hi Danny, thanks for jumping on this and the detailed analysis.
I plan to have a lot of the validation evaluated late for default values rather than at construction
Late validation seems ok to me. Loading a table shouldn't fail because of a bad default on a column the query never touches.
Just to make sure I understand this correctly: we still want to validate the default values that we write in iceberg-rust, so we ensure that iceberg-rust doesn't produce metadata that we couldn't read, correct?
Hi Danny, thanks for jumping on this and the detailed analysis.
I plan to have a lot of the validation evaluated late for default values rather than at construction
Late validation seems ok to me. Loading a table shouldn't fail because of a bad default on a column the query never touches.
Just to make sure I understand this correctly: we still want to validate the default values that we write in iceberg-rust, so we ensure that iceberg-rust doesn't produce metadata that we couldn't read, correct?
That's nuanced. I want to validate anything we change in iceberg-rust - so if a column has a bad default on load, we'll still write it into new metadata. But if we construct a TableMetadata with an updated schema or use the update schema actions, those will validate so we don't introduce bad defaults.
The deferred defaults is going to be a bit more involved than I thought to defer all validation, since deserialization will flag things like a string instead of an int. I'll have a think on if we want to defer all of it or not.
Activity
dannycjones commentedon Sep 18, 2026
Tying this to V3: #2411
I see a bunch of this is already implemented, this is to track how much is actually implemented and what gaps remain, such that we can call V3 complete, tested, and spec compliant. Thanks all!
Edit to document what I've found so far (2025-10-02):
UpdateSchema#1357To triage:
[-]Support for default and initial value[/-][+]Support for write default and initial default[/+]dannycjones commentedon Sep 21, 2026
I'd like to take ownership of this one, I've been prototyping it a bunch. However if anyone would really like to take it, ping me, I don't want to block this.
dannycjones commentedon Sep 22, 2026
FYI @blackmwk @CTTY. I plan to have a lot of the validation evaluated late for default values rather than at construction. In other words, we can load the table with a bad default just fine but only on read or write might it fail.
The reason for this being that tables with bad defaults may otherwise be working for the use case: projecting columns that don't have bad defaults, writing to files where the column is always provided so default is never needed, etc..
I'm raising this as this feels to be heading in the opposite direction of other changes, like validating construction of types allowing them only to be constructed or deserialized if they are valid. I'm wondering what your take is here.
CTTY commentedon Sep 22, 2026
Hi Danny, thanks for jumping on this and the detailed analysis.
Late validation seems ok to me. Loading a table shouldn't fail because of a bad default on a column the query never touches.
Just to make sure I understand this correctly: we still want to validate the default values that we write in iceberg-rust, so we ensure that iceberg-rust doesn't produce metadata that we couldn't read, correct?
dannycjones commentedon Sep 23, 2026
That's nuanced. I want to validate anything we change in iceberg-rust - so if a column has a bad default on load, we'll still write it into new metadata. But if we construct a
TableMetadatawith an updated schema or use the update schema actions, those will validate so we don't introduce bad defaults.The deferred defaults is going to be a bit more involved than I thought to defer all validation, since deserialization will flag things like a string instead of an int. I'll have a think on if we want to defer all of it or not.