Skip to content

[python] Support tag rename and replace in the CLI - #10477

Open
Stephen0421 wants to merge 1 commit into
apache:masterfrom
Stephen0421:python-cli-tag-rename-replace
Open

Stephen0421 wants to merge 1 commit into
apache:masterfrom
Stephen0421:python-cli-tag-rename-replace

Conversation

@Stephen0421

Copy link
Copy Markdown
Contributor

Purpose

Add paimon tag rename and paimon tag replace for filesystem catalogs, and let paimon tag create set a retention.

Filesystem catalogs delegate to the existing FileStoreTable.rename_tag and replace_tag. A missing tag or a conflicting new name becomes TagNotExistException or TagAlreadyExistException. A missing snapshot stays a ValueError.

REST catalogs reject both commands. The REST API only has create, get, list, and delete. Rewriting the tag file from the client would leave the server registry pointing at a name whose file is gone, and would skip the permission checks used by the other tag commands.

tag create --time-retained passes the retention through to catalog.create_tag. On replace, omitting --time-retained rewrites the tag as a plain snapshot reference and drops a retention that was already set. That matches the existing tag-file format.

paimon tag rename mydb.users v1 v2
paimon tag replace mydb.users v1 --snapshot-id 3 --time-retained 12h
paimon tag create mydb.users v1 --time-retained 12h

Test plan

  • cli_tag_test: rename, name conflict, replace to a snapshot and to latest, create and replace with 12h, missing tag, missing snapshot, replace without --time-retained drops TTL
  • rest_tag_test: rename and replace raise NotImplementedError and leave the server tag registry unchanged

Filesystem catalogs rename and replace tag files. REST catalogs reject both because the API has no endpoint, so the CLI does not rewrite tag files behind the server.
@Stephen0421 Stephen0421 reopened this Oct 10, 2026
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.

1 participant