Skip to content

Support for write default and initial default #3250

Open

Description

@dannycjones

Is your feature request related to a problem or challenge?

Apache Iceberg table format V3 introduced default values, with the fields initial_default and write_default. https://iceberg.apache.org/spec/#default-values

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.

Willingness to contribute

I can contribute to this feature independently

Activity

  1. dannycjones commented on Sep 18, 2026

    @dannycjones
    ContributorAuthor

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

    To triage:

  2. changed the title [-]Support for default and initial value[/-] [+]Support for write default and initial default[/+] on Sep 18, 2026
  3. dannycjones commented on Sep 21, 2026

    @dannycjones
    ContributorAuthor

    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.

  4. dannycjones commented on Sep 22, 2026

    @dannycjones
    ContributorAuthor

    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.

  5. CTTY commented on Sep 22, 2026

    @CTTY
    Collaborator

    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?

  6. dannycjones commented on Sep 23, 2026

    @dannycjones
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions