Skip to content

Add support for 'overwrite' option in register_table#3290

Open
ebyhr wants to merge 1 commit intoapache:mainfrom
ebyhr:ebi/register-table-overwrite
Open

Add support for 'overwrite' option in register_table#3290
ebyhr wants to merge 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?

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?

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.

5 participants