dimas-b commented on code in PR #1147:
URL: https://github.com/apache/polaris/pull/1147#discussion_r1994659901


##########
polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntityType.java:
##########
@@ -32,9 +32,10 @@ public enum PolarisEntityType {
   CATALOG_ROLE(5, CATALOG, true, false),
   NAMESPACE(6, CATALOG, false, true),
   // generic table is either a view or a real table
-  TABLE_LIKE(7, NAMESPACE, false, false),
+  ICEBERG_TABLE_LIKE(7, NAMESPACE, false, false),
   TASK(8, ROOT, false, false),
-  FILE(9, TABLE_LIKE, false, false);
+  FILE(9, ICEBERG_TABLE_LIKE, false, false),
+  GENERIC_TABLE(10, NAMESPACE, false, false);

Review Comment:
   From my POV it's ok to treat them as siblings (also hinted at that in 
another comment).
   
   In larger context, having only type + sub-type seems rather awkward for a 
type system.... but I imagine this is not refactorable until Polaris 2.0 :)



##########
polaris-core/src/main/java/org/apache/polaris/core/entity/GenericTableEntity.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * 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.core.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.apache.iceberg.catalog.Namespace;
+import org.apache.iceberg.catalog.TableIdentifier;
+import org.apache.iceberg.rest.RESTUtil;
+
+/**
+ * A {@link PolarisEntity} implementation for generic tables. These tables are 
not Iceberg-like in
+ * that they may not have a schema or base location. Similarly to {@link 
IcebergTableLikeEntity}
+ * however, these tables have an identifier and a parent namespace.
+ */
+public class GenericTableEntity extends PolarisEntity {

Review Comment:
   Did we settle on the term "Generic Table" in the design doc (I genuinely do 
not recall)?
   
   Conceptually, I'd expect Iceberg tables to be a sub-type of "generic table", 
but it is not so...
   
   How about `UnstructuredTable`?



##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogPrefixParser.java:
##########
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.polaris.service.catalog;
+package org.apache.polaris.service.catalog.iceberg;

Review Comment:
   I agree with the first comment. The intent behind this prefix parser was to 
apply it to all catalog-like APIs.
   
   Given that "generic" tables are going to be accessed from Spark as well as 
Iceberg Tables, I believe the prefix handling should be the same for both APIs.



##########
service/common/src/main/java/org/apache/polaris/service/catalog/generic/PolarisGenericTableCatalog.java:
##########
@@ -0,0 +1,162 @@
+/*
+ * 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.service.catalog.generic;
+
+import jakarta.ws.rs.core.SecurityContext;
+import java.util.List;
+import java.util.Map;
+import org.apache.iceberg.catalog.TableIdentifier;
+import org.apache.iceberg.exceptions.AlreadyExistsException;
+import org.apache.iceberg.exceptions.NoSuchTableException;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.entity.CatalogEntity;
+import org.apache.polaris.core.entity.GenericTableEntity;
+import org.apache.polaris.core.entity.PolarisEntity;
+import org.apache.polaris.core.entity.PolarisEntitySubType;
+import org.apache.polaris.core.entity.PolarisEntityType;
+import org.apache.polaris.core.persistence.PolarisEntityManager;
+import org.apache.polaris.core.persistence.PolarisMetaStoreManager;
+import org.apache.polaris.core.persistence.PolarisResolvedPathWrapper;
+import org.apache.polaris.core.persistence.dao.entity.BaseResult;
+import org.apache.polaris.core.persistence.dao.entity.EntityResult;
+import 
org.apache.polaris.core.persistence.resolver.PolarisResolutionManifestCatalogView;
+import org.apache.polaris.service.catalog.io.FileIOFactory;
+import org.apache.polaris.service.task.TaskExecutor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class PolarisGenericTableCatalog {

Review Comment:
   I can see that having this class follows the existing code patterns. 
However, from a more general POV, by treating "generic" tables and Iceberg 
tables separately we're losing the ability to handle multi-entity changes in 
Polaris atomically. 
   
   In effect Polaris moves toward being a union of catalogs rather than a 
single catalog. I believe the latter approach (single catalog) is more 
architecturally sound (even though it is harder to implement initially).
   
   Existing Polaris Persistence APIs allow for a single catalog model, I 
believe.



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