You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/12/28 19:50:44 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #1979: Support for role based access of HadoopCatalog table listing #1941

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



##########
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;
+    }
+  }
+
+  private boolean isDirectory(Path path) {
+    try {
+      return fs.getFileStatus(path).isDirectory();
+    } catch (IOException e) {
+      return false;

Review comment:
       This should throw either `RuntimeIOException` or `UncheckedIOException`. If the status can't be loaded, returning false is not correct.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org