lidavidm commented on a change in pull request #10008: URL: https://github.com/apache/arrow/pull/10008#discussion_r615114195
########## File path: cpp/src/arrow/util/iterator_test.cc ########## @@ -145,6 +145,23 @@ void AssertIteratorNext(T expected, Iterator<T>& it) { ASSERT_EQ(expected, actual); } +template <typename T> +Iterator<T> FailsAt(Iterator<T> source, int failure_index, Status failure) { + struct Iter { + Result<T> Next() { + if (index++ == failure_index) { + return failure; + } + return source.Next(); + } + Iterator<T> source; + int failure_index; + Status failure; + int index; + }; + return Iterator<T>(Iter{std::move(source), failure_index, std::move(failure), 0}); +} + Review comment: If I'm not mistaken, FailsAt and AssertBufferIteratorMatch are now entirely unused? ########## File path: cpp/src/arrow/dataset/scanner.h ########## @@ -51,6 +52,8 @@ constexpr int64_t kDefaultBatchSize = 1 << 20; constexpr int32_t kDefaultBatchReadahead = 32; constexpr int32_t kDefaultFragmentReadahead = 8; +using FragmentGenerator = std::function<Future<std::shared_ptr<Fragment>>()>; Review comment: I think moving the subclass definitions means you can also move this alias and get rid of the async_generator.h include. -- 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: us...@infra.apache.org