tom-s-powell commented on code in PR #19147:
URL: https://github.com/apache/iceberg/pull/19147#discussion_r4707070079


##########
core/src/main/java/org/apache/iceberg/hadoop/HadoopFileIO.java:
##########
@@ -157,6 +162,43 @@ public Iterable<FileInfo> listPrefix(String prefix) {
     };
   }
 
+  @Override
+  public Iterable<PrefixListingPage> listDirectory(String prefix) {
+    Preconditions.checkArgument(
+        prefix != null && prefix.endsWith("/"), "Directory prefix must end 
with '/': %s", prefix);
+    Path directory = new Path(prefix);
+    FileSystem fs = Util.getFs(directory, getConf());
+
+    return () -> {
+      try {
+        if (!fs.getFileStatus(directory).isDirectory()) {
+          throw new FileNotFoundException("Not a directory: " + prefix);
+        }
+
+        List<FileInfo> files = Lists.newArrayList();
+        List<String> subPrefixes = Lists.newArrayList();
+        for (FileStatus status : fs.listStatus(directory)) {
+          if (status.isDirectory()) {

Review Comment:
   Good shout, made that change



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


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

Reply via email to