ajantha-bhat commented on code in PR #14870:
URL: https://github.com/apache/iceberg/pull/14870#discussion_r2630933556


##########
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 did ask about this optional defaultCatalog field long ago and got an 
https://github.com/apache/iceberg/issues/10410#issuecomment-2146929374 that it 
was for Spark.
   
   Updating the metadata (with new catalog name) will leads to new metadata 
file which is not exactly a register case. So, If the engines requires it they 
can update the view with the new catalog name (only for Spark I guess) by 
adding the new version.
   
   @nastra can add more on this as he was handling this during view spec design.



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