deniskuzZ commented on code in PR #3746:
URL: https://github.com/apache/hive/pull/3746#discussion_r1034433076


##########
common/src/java/org/apache/hadoop/hive/common/FileUtils.java:
##########
@@ -1347,4 +1352,35 @@ public static RemoteIterator<LocatedFileStatus> 
listFiles(FileSystem fs, Path pa
     return RemoteIterators.filteringRemoteIterator(fs.listFiles(path, 
recursive),
         status -> filter.accept(status.getPath()));
   }
+
+  public static <T> Stream<T> asStream(RemoteIterator<T> iterator) {
+    return StreamSupport.stream(Spliterators.spliteratorUnknownSize(new 
RemoteIteratorWrapper<T>(iterator), Spliterator.ORDERED), false);
+  }
+
+  static class RemoteIteratorWrapper<T> implements Iterator {

Review Comment:
   check if `HadoopFileIO.AdaptingIterator` could be used instead



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