gh-yzou commented on code in PR #1190:
URL: https://github.com/apache/polaris/pull/1190#discussion_r2001958228


##########
plugins/spark/src/main/java/org/apache/polaris/spark/SparkCatalog.java:
##########
@@ -0,0 +1,180 @@
+/*
+ * 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.polaris.spark;
+
+import com.google.common.collect.ImmutableSet;
+import java.util.Map;
+import java.util.Set;
+import org.apache.iceberg.exceptions.NoSuchTableException;
+import org.apache.iceberg.spark.SupportsReplaceView;
+import org.apache.spark.sql.catalyst.analysis.*;
+import org.apache.spark.sql.connector.catalog.*;
+import org.apache.spark.sql.connector.expressions.Transform;
+import org.apache.spark.sql.types.StructType;
+import org.apache.spark.sql.util.CaseInsensitiveStringMap;
+
+public class SparkCatalog

Review Comment:
   I think one of the biggest problem with the extends approach is that 
org.apache.iceberg.spark.SparkCatalog is not really extendable. The methods 
initialize is defined as *final* in Iceberg SparkCatalog
   ```
   public final void initialize(String name, CaseInsensitiveStringMap options)
   ```
   The initialize method is called by spark after the SparkCatalog class is 
created, and Polaris SparkCatalog needs to implement the initialize methods to 
also initialize the PolarisRestClient later, but with the extend approach, I 
couldn't override the initialize method.
   
   Another reason is that i think the current structure makes things more 
clear, where it clearly associates with two clients: iceberg and polaris. It 
also gives us some better control about the interfaces that is currently 
supported, for example, the IcebergSparkCatalog also implements the 
FunctionCatalog, which is not supported by Polaris.
   
   Since most of the function is just direct passthrough, the current setup 
seems more preferable to me.



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

Reply via email to