Skip to content

[rest] Add database branch and tag APIs - #9879

Draft
JingsongLi wants to merge 4 commits into
apache:masterfrom
JingsongLi:codex/database-branch-tag-rest
Draft

JingsongLi wants to merge 4 commits into
apache:masterfrom
JingsongLi:codex/database-branch-tag-rest

Conversation

@JingsongLi

@JingsongLi JingsongLi commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Purpose

Add database-level writable branches and immutable tags to the REST client and protocol, exposed through RESTCatalog.treeManagement(). Callers can page through references, inspect a reference, create a branch or tag from an existing reference, fast-forward a branch to an immutable tag, and delete references.

  • Introduce TreeManagement and RESTTreeManagement, reusing the catalog's configured HTTP client, authentication, and prefix.
  • Add the /trees endpoints, reference models, DatabaseReferenceResponse, pagination, and HTTP client support to the REST OpenAPI specification and client.
  • Use dedicated JSON request objects for create, fast-forward, and delete. GET filtering and pagination use query parameters.
  • Expose fast-forward as POST /v1/{prefix}/databases/{database}/trees/{name}/forward, following the table-level forward operation's path and HTTP method.

This PR provides the reference-management client and protocol surface. Reference persistence requires a catalog server implementation.

Tests

  • mvn -pl paimon-core -am -DwildcardSuites=none -DfailIfNoTests=false -Dtest=RESTCatalogTreeManagementTest,RESTApiDatabaseReferenceTest test — 7 tests covering catalog configuration, branch/tag operations, the forward route and JSON body, pagination, and error propagation; Checkstyle, Spotless, and Enforcer enabled.
  • OpenAPI YAML parse, reference, and path-parameter validation.
  • git diff --check.

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