lidavidm commented on a change in pull request #10124:
URL: https://github.com/apache/arrow/pull/10124#discussion_r617735268
##########
File path: cpp/src/arrow/dataset/scanner_test.cc
##########
@@ -319,6 +322,23 @@ class FailingFragment : public InMemoryFragment {
return std::make_shared<InMemoryScanTask>(batches, options, self);
});
}
+
+ Result<RecordBatchGenerator> ScanBatchesAsync(
+ const std::shared_ptr<ScanOptions>& options) override {
+ struct {
+ Future<std::shared_ptr<RecordBatch>> operator()() {
+ if (index > 16) {
+ return Status::Invalid("Oh no, we failed!");
+ }
+ auto batch = batches[index++ % batches.size()];
+ return Future<std::shared_ptr<RecordBatch>>::MakeFinished(batch);
+ }
+ RecordBatchVector batches;
+ int index = 0;
+ } Generator;
Review comment:
Yup, it's used quite a bit in the datasets implementation (e.g. see
ParquetScanTask in file_parquet.cc).
--
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]