Skip to content

IRC does not support creating V1 table via snapshot procedure (stage create) #12500

@puchengy

Description

@puchengy

Apache Iceberg version

1.5.2

Query engine

Spark

Please describe the bug 🐞

CatalogHandlers (used by Rest Catalog) when executing updateTable with transaction code will always create an empty builder of default table version 2 (in Iceberg 1.5.2). This does not work if user intentionally want to create v1 table, as a result, query like

CALL spark_catalog.system.snapshot(..., map('format-version', '1');

will fail with Cannot downgrade v2 table to v1 error.

A propose fix is when calling TableMetadata.buildFromEmpty() we honor the format version if the request already set it.

Willingness to contribute

  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions