westonpace commented on a change in pull request #9607:
URL: https://github.com/apache/arrow/pull/9607#discussion_r605535258



##########
File path: cpp/src/arrow/dataset/dataset.h
##########
@@ -133,8 +130,20 @@ class ARROW_DS_EXPORT Dataset : public 
std::enable_shared_from_this<Dataset> {
   Result<std::shared_ptr<ScannerBuilder>> NewScan();
 
   /// \brief GetFragments returns an iterator of Fragments given a predicate.
-  Result<FragmentIterator> GetFragments(Expression predicate);
-  Result<FragmentIterator> GetFragments();
+  Future<FragmentVector> GetFragmentsAsync(Expression predicate);
+  Result<FragmentIterator> GetFragments(Expression predicate) {
+    auto fut = GetFragmentsAsync(predicate);
+    fut.Wait();
+    ARROW_ASSIGN_OR_RAISE(auto fragments_vec, fut.result());
+    return MakeVectorIterator(fragments_vec);
+  }
+  Future<FragmentVector> GetFragmentsAsync();
+  Result<FragmentIterator> GetFragments() {
+    auto fut = GetFragmentsAsync();
+    fut.Wait();
+    ARROW_ASSIGN_OR_RAISE(auto fragments_vec, fut.result());

Review comment:
       Cleaned up.




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


Reply via email to