shtripat opened a new pull request, #753:
URL: https://github.com/apache/iceberg-go/pull/753
## 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: https://github.com/apache/iceberg-go/issues/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
- 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]