steveloughran commented on a change in pull request #1979:
URL: https://github.com/apache/iceberg/pull/1979#discussion_r560909406



##########
File path: core/src/main/java/org/apache/iceberg/hadoop/HadoopCatalog.java
##########
@@ -139,6 +139,25 @@ public String name() {
     return catalogName;
   }
 
+  private boolean isTableDir(Path path) {
+    Path metadataPath = new Path(path, "metadata");
+    // Only the path which contains metadata is the path for table, otherwise 
it could be
+    // still a namespace.
+    try {
+      return fs.listStatus(metadataPath, TABLE_FILTER).length >= 1;
+    } catch (IOException e) {
+      return false;

Review comment:
       this is really brittle design. It will only work for one specific store 
and contains the assumption that the store always returns the string 
"AuthorizationPermissionMismatch" on an error. If the abfs store *ever* changed 
that string everything will break.
   
   * That abfs exception also includes a status code, 403, which is what should 
really be used as the signal.
   * Other stores return AccessDeniedException. Has anyone considered filing a 
hadoop bug asking for translation of rest exceptions with 403s into those? I am 
reasonably confident nobody is going reject PRs there.
   




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to