gaborkaszab commented on code in PR #14870:
URL: https://github.com/apache/iceberg/pull/14870#discussion_r2630910866


##########
core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java:
##########
@@ -593,6 +594,18 @@ public static void dropView(ViewCatalog catalog, 
TableIdentifier viewIdentifier)
     }
   }
 
+  public static LoadViewResponse registerView(
+      ViewCatalog catalog, Namespace namespace, RegisterViewRequest request) {
+    request.validate();
+
+    TableIdentifier identifier = TableIdentifier.of(namespace, request.name());
+    View view = catalog.registerView(identifier, request.metadataLocation());
+    return ImmutableLoadViewResponse.builder()
+        .metadata(asBaseView(view).operations().current())

Review Comment:
   I have the same comment/question here as on the PR for other catalog types: 
if the default Catalog name is persisted in the view metadata than in case we 
register this view into another catalog, the default catalog won't change. 
Would this mean that it's a requirement for the engines to refer to the new 
catalog with the same name as the source catalog?



##########
core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java:
##########
@@ -474,6 +476,23 @@ public <T extends RESTResponse> T handleRequest(
           break;
         }
 
+      case REGISTER_VIEW:
+        {
+          if (null != asViewCatalog) {
+            LoadViewResponse response =
+                CatalogHandlers.registerView(
+                    asViewCatalog,
+                    namespaceFromPathVars(vars),
+                    castRequest(RegisterViewRequest.class, body));
+
+            responseHeaders.accept(

Review Comment:
   We don't send ETags for views ATM



-- 
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]

Reply via email to