shtripat opened a new issue, #752:
URL: https://github.com/apache/iceberg-go/issues/752
### Feature Request / Improvement
### Background
rest.Catalog already exposes RegisterTable(ctx, identifier,
metadataLocation) which POSTs to POST
/v1/{prefix}/namespaces/{namespace}/register. There is no equivalent for views.
The Iceberg REST OpenAPI spec on main defines the symmetric endpoint:
POST /v1/{prefix}/namespaces/{namespace}/register-view
body: { "name": "...", "metadata-location": "..." }
response: LoadViewResponse
The Java library merged registerView() support across ViewCatalog
implementations (JDBC, Hive, Nessie, InMemory) in apache/iceberg#14868. REST
catalog support was deferred in that PR, pending IRC spec acceptance. The spec
endpoint is now present.
### Problem
Without RegisterView, the only way to migrate a view between REST catalogs
in Go is LoadView (source) + CreateView (target). This is lossy:
- CreateView enforces version.VersionID = 1, resetting version history
- CreateView overwrites defaultCatalog with the target catalog name,
breaking Spark/Trino clients that resolve unqualified table references through
it
- The view gets a new UUID and fresh timestamps — it is a new view, not a
registration of the existing one
RegisterView sidesteps all of this by pointing the catalog at the existing
metadata file, exactly as RegisterTable does for tables.
### Proposed API
```
// RegisterView registers an existing view in the catalog using its metadata
file location.
// The metadata file must already be accessible to the catalog.
func (r *Catalog) RegisterView(ctx context.Context, identifier
table.Identifier, metadataLoc string) (*view.View, error)
```
--
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]