jackye1995 commented on code in PR #7880:
URL: https://github.com/apache/iceberg/pull/7880#discussion_r1246911014


##########
core/src/main/java/org/apache/iceberg/BaseMetastoreViewCatalog.java:
##########
@@ -0,0 +1,233 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.iceberg.catalog.Namespace;
+import org.apache.iceberg.catalog.TableIdentifier;
+import org.apache.iceberg.catalog.ViewCatalog;
+import org.apache.iceberg.exceptions.AlreadyExistsException;
+import org.apache.iceberg.exceptions.CommitFailedException;
+import org.apache.iceberg.exceptions.NoSuchViewException;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
+import org.apache.iceberg.view.BaseView;
+import org.apache.iceberg.view.ImmutableSQLViewRepresentation;
+import org.apache.iceberg.view.ImmutableViewHistoryEntry;
+import org.apache.iceberg.view.ImmutableViewMetadata;
+import org.apache.iceberg.view.ImmutableViewVersion;
+import org.apache.iceberg.view.View;
+import org.apache.iceberg.view.ViewBuilder;
+import org.apache.iceberg.view.ViewMetadata;
+import org.apache.iceberg.view.ViewOperations;
+import org.apache.iceberg.view.ViewRepresentation;
+import org.apache.iceberg.view.ViewVersion;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class BaseMetastoreViewCatalog extends BaseMetastoreCatalog 
implements ViewCatalog {
+  private static final Logger LOG = 
LoggerFactory.getLogger(BaseMetastoreViewCatalog.class);
+
+  protected abstract ViewOperations newViewOps(TableIdentifier viewIdentifier);
+
+  @Override
+  public void initialize(String name, Map<String, String> properties) {}
+
+  @Override
+  public String name() {
+    return super.name();
+  }
+
+  @Override
+  public ViewBuilder buildView(TableIdentifier identifier) {
+    return new BaseViewBuilder(identifier);
+  }
+
+  protected class BaseViewBuilder implements ViewBuilder {
+    private final TableIdentifier viewIdentifier;
+    private final ImmutableViewVersion.Builder viewVersionBuilder = 
ImmutableViewVersion.builder();
+    private final ImmutableSQLViewRepresentation.Builder 
viewRepresentationBuilder =

Review Comment:
   this assumes we have SQL representation, and we don't really have a path 
forward to adopt other representations in this ViewBuilder interface. That goes 
back to the last comment, should we just use the immutable builder to build the 
information, and only keep the `create()`, `replace()` and `createOrReplace()` 
in the current ViewBuilder to complete the operation?



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