rdsr commented on a change in pull request #1200:
URL: https://github.com/apache/iceberg/pull/1200#discussion_r454121284



##########
File path: core/src/main/java/org/apache/iceberg/hadoop/HadoopCatalog.java
##########
@@ -276,8 +277,11 @@ public boolean dropNamespace(Namespace namespace) {
     }
 
     try {
-      return fs.delete(nsPath, false /* recursive */);
+      if (fs.listStatus(nsPath).length != 0) {

Review comment:
       `listStatus` returns an array which means it lists all the files before 
returning. Should we use `listFiles` which returns an Iterator. Iterator could 
be a lot more efficient as we do not need to list all the underlying files in 
the dir and we can simply do `listFiles.hasNext`




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