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


##########
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 {
+
+  public static final String FORMAT_KEY = "format";

Review Comment:
   do you need another key for table properties? i believe the 
InternalProperties and properties fields in Polaris Entity is not the same as 
table properties? We can also add this in a separate pr, maybe just left a TODO 
here



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

Review Comment:
   can we also put this module specific to generictables to organize the code 
in a more fine grained structure?



##########
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 {
+
+  public static final String FORMAT_KEY = "format";
+
+  public GenericTableEntity(PolarisBaseEntity sourceEntity) {
+    super(sourceEntity);
+  }
+
+  public static GenericTableEntity of(PolarisBaseEntity sourceEntity) {
+    if (sourceEntity != null) {
+      return new GenericTableEntity(sourceEntity);
+    }
+    return null;
+  }
+
+  @JsonIgnore
+  public String getFormat() {
+    return getInternalPropertiesAsMap().get(GenericTableEntity.FORMAT_KEY);

Review Comment:
   I am not sure what is the usage distinguish between InternalProperties and 
Properties, i assume the InternalProperties is used to store fields that we 
will not return in any response to user like metadata location, but properties 
are used to store fields that will be directly surface back to user, like base 
location. if that is the case, i assume format should be stored in property 
map. 



##########
polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisPrivilege.java:
##########
@@ -41,22 +41,22 @@ public enum PolarisPrivilege {
   TABLE_CREATE(6, PolarisEntityType.NAMESPACE),
   VIEW_CREATE(7, PolarisEntityType.NAMESPACE),
   NAMESPACE_DROP(8, PolarisEntityType.NAMESPACE),
-  TABLE_DROP(9, PolarisEntityType.TABLE_LIKE, PolarisEntitySubType.TABLE),
-  VIEW_DROP(10, PolarisEntityType.TABLE_LIKE, PolarisEntitySubType.VIEW),
+  TABLE_DROP(9, PolarisEntityType.ICEBERG_TABLE_LIKE, 
PolarisEntitySubType.TABLE),

Review Comment:
   I guess we can make things work either way, but might want to hear little 
bit more about how the entity type and sub entity type is designed to be used 
in Polaris. 



##########
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 took another look of the PR, i think we might be fine since most of the 
change seems caused by rename/relocation, no real functionality change, let's 
see how other people think. We can further break this down if people want a 
smaller PR.



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