rdblue commented on code in PR #7913:
URL: https://github.com/apache/iceberg/pull/7913#discussion_r1342187760
##########
core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java:
##########
@@ -374,4 +385,107 @@ static TableMetadata commit(TableOperations ops,
UpdateTableRequest request) {
return ops.current();
}
+
+ public static BaseView baseView(View view) {
+ Preconditions.checkArgument(view instanceof BaseView, "View must be a
BaseView");
+ return (BaseView) view;
+ }
+
+ public static ListTablesResponse listViews(ViewCatalog catalog, Namespace
namespace) {
+ return
ListTablesResponse.builder().addAll(catalog.listViews(namespace)).build();
+ }
+
+ public static LoadViewResponse createView(
+ ViewCatalog catalog, Namespace namespace, CreateViewRequest request) {
+ request.validate();
+
+ ViewMetadata viewMetadata = request.metadata();
Review Comment:
This should not pass full view metadata. It should pass the parts of view
metadata that are used to create a view, just like tables.
Otherwise, the contract for this route is confusing and loses data. The code
below only uses `currentVersion`, but what if `currentVersion` is not the only
version?
--
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]