adutra commented on code in PR #4963:
URL: https://github.com/apache/polaris/pull/4963#discussion_r3521063983


##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalog.java:
##########
@@ -1025,6 +1028,7 @@ public View registerView(TableIdentifier identifier, 
String metadataFileLocation
 
     InputFile metadataFile = fileIO.newInputFile(metadataFileLocation);
     ViewMetadata metadata = ViewMetadataParser.read(metadataFile);
+    validateMetadataFileInTableDir(identifier, metadata.location(), 
metadataFileLocation);

Review Comment:
   I think you also need to call `validateLocationForTableLike` – the 
`metadata.location()` value must be valid wrt to the storage configuration from 
the table hierarchy, AND wrt to the table directory, if escaping the directory 
is not allowed:
   
   ```suggestion
       validateLocationForTableLike(identifier, metadata.location(), 
resolvedParent);
       validateMetadataFileInTableDir(identifier, metadata.location(), 
metadataFileLocation);
   ```



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