feat(rest): add RegisterView to REST catalog#753
Merged
zeroshade merged 1 commit intoapache:mainfrom Mar 4, 2026
Merged
Conversation
Description:
Closes #[issue] (file the companion issue first and link it here)
Adds RegisterView(ctx, identifier, metadataLocation) to rest.Catalog,
the view equivalent of the existing RegisterTable. The method POSTs to POST
/v1/{prefix}/namespaces/{namespace}/register-view as defined in the
Iceberg REST catalog OpenAPI specification.
Motivation
The only way to migrate a view between REST catalogs without this method is
LoadView + CreateView. That approach is lossy: CreateView resets version-id to 1,
reassigns default-catalog to the target catalog name, and creates a new UUID
— producing a new view rather than a registration of the existing one.
RegisterView avoids all of this by pointing the target catalog at the existing
metadata file, exactly as RegisterTable does for tables.
Changes
- catalog/rest/rest.go: RegisterView on *Catalog — POSTs {name, metadata-location}
to /namespaces/{ns}/register-view, parses the response through the existing loadViewResponse
path, maps 404 → ErrNoSuchNamespace and 409 → ErrViewAlreadyExists.
- catalog/rest/rest_test.go: three test cases covering the 200, 404, and 409 responses,
following the same structure as the existing TestRegisterTable{200,404,409} tests.
Related
- Java implementation: apache/iceberg#14868
- REST OpenAPI spec: open-api/rest-catalog-open-api.yaml — operationId registerView
- Mailing list discussion: https://lists.apache.org/thread/mxqz0fp6vz3nt7nl70wgrz6d2gr41rzj
Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
twuebi
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Adds RegisterView(ctx, identifier, metadataLocation) to rest.Catalog, the view equivalent of the existing RegisterTable. The method POSTs to POST /v1/{prefix}/namespaces/{namespace}/register-view as defined in the Iceberg REST catalog OpenAPI specification.
Motivation
Fixes: #752
The only way to migrate a view between REST catalogs without this method is LoadView + CreateView. That approach is lossy: CreateView resets version-id to 1, reassigns default-catalog to the target catalog name, and creates a new UUID — producing a new view rather than a registration of the existing one. RegisterView avoids all of this by pointing the target catalog at the existing metadata file, exactly as RegisterTable does for tables.
Changes
Related