Skip to content

Add support for 'overwrite' option in register_table#3290

Merged
Fokko merged 1 commit intoapache:mainfrom
ebyhr:ebi/register-table-overwrite
May 4, 2026
Merged

Add support for 'overwrite' option in register_table#3290
Fokko merged 1 commit intoapache:mainfrom
ebyhr:ebi/register-table-overwrite

Conversation

@ebyhr
Copy link
Copy Markdown
Member

@ebyhr ebyhr commented Apr 26, 2026

Rationale for this change

Are these changes tested?

Are there any user-facing changes?

This PR adds overwrite parameter to catalog.register_table method.

@gabeiglio
Copy link
Copy Markdown
Contributor

Looks good to me, one small nit would be to add some tests in integration tests here if the iceberg rest image supports the overwriting flag

@ebyhr
Copy link
Copy Markdown
Member Author

ebyhr commented Apr 26, 2026

The current test target (1.10.0) supports the option in OpenAPI yml, but the catalog doesn't support it. We can add an integration test once 1.11.0 (apache/iceberg#15525) is released.

@ebyhr ebyhr changed the title Add support for 'overwrite' option in register_view Add support for 'overwrite' option in register_table Apr 27, 2026
@djouallah
Copy link
Copy Markdown

any chance for this to get merged, currently, i am doing tuncate and add files with other tool, and it is a pain as it is not atomic

Copy link
Copy Markdown
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a few nits

Args:
identifier (Union[str, Identifier]): Table identifier for the table
metadata_location (str): The location to the metadata
overwrite (bool): Whether to overwrite the existing table, default False
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add NotImplementedError here too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method in dynamodb and noop always raises NotImplementedError. Do we still need a separate logc for the overwrite argument?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see NotImplementedError in other implementations but not for dynamodb/noop
is that intended?

Comment thread pyiceberg/catalog/noop.py
Args:
identifier (Union[str, Identifier]): Table identifier for the table
metadata_location (str): The location to the metadata
overwrite (bool): Whether to overwrite the existing table, default False
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: raise NotImplementedError here too?

@Fokko Fokko merged commit 0dce453 into apache:main May 4, 2026
16 checks passed
@Fokko
Copy link
Copy Markdown
Contributor

Fokko commented May 4, 2026

Looks good to me, one small nit would be to add some tests in integration tests here if the iceberg rest image supports the overwriting flag

Right now we're locked at an older version of the Image: #3240. Once there is a new Java release, we can definitly add this test.

any chance for this to get merged, currently, i am doing tuncate and add files with other tool, and it is a pain as it is not atomic

@djouallah Since everybody approved, I went ahead and merged this 👍

Thanks @ebyhr for working on this, and thanks @ndrluis and @kevinjqliu for the review 🚀

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants