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


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -1359,7 +1360,9 @@ public void doCommit(TableMetadata base, TableMetadata 
metadata) {
                 .setMetadataLocation(newLocation)
                 .build();
       }
-      if (!Objects.equal(existingLocation, oldLocation)) {
+      if (entity.getSubType() == PolarisEntitySubType.GENERIC_TABLE) {

Review Comment:
   i see we are doing check of conflicting of view here 
https://github.com/apache/polaris/pull/1231/files#diff-1e0bdc1f194df7cceed5d4b2ddad483199b80d090a1c682f92ecf5fec5f83b2fR1325,
 in that sense, i think it make more sense to just add a check with 
GENERIC_TABLE in the same way as VIEW, and when we resolve the entity here, 
just directly resolve with ICEBERG_TABLE instead of ANY_SUBTYPE. 



##########
service/common/src/main/java/org/apache/polaris/service/catalog/generic/GenericTableCatalog.java:
##########
@@ -97,10 +101,9 @@ public void createGenericTable(
 
     List<PolarisEntity> catalogPath = resolvedParent.getRawFullPath();
 
-    // TODO we need to filter by type here?
     PolarisResolvedPathWrapper resolvedEntities =
         resolvedEntityView.getPassthroughResolvedPath(
-            tableIdentifier, PolarisEntityType.GENERIC_TABLE, 
PolarisEntitySubType.ANY_SUBTYPE);
+            tableIdentifier, PolarisEntityType.TABLE_LIKE, 
PolarisEntitySubType.ANY_SUBTYPE);

Review Comment:
   shall we stay consistent as how createTable in iceberg check the conflict 
with views, 
   ```
   PolarisResolvedPathWrapper resolvedView =
             resolvedEntityView.getPassthroughResolvedPath(
                 tableIdentifier, PolarisEntityType.TABLE_LIKE, 
PolarisEntitySubType.VIEW);
         if (resolvedView != null) {
           throw new AlreadyExistsException("View with same name already 
exists: %s", tableIdentifier);
         }
   ```
   
   where we just look into each subtype and give a clear message that what kind 
of entity it is conflict with?



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