westonpace commented on code in PR #13205:
URL: https://github.com/apache/arrow/pull/13205#discussion_r878616768
##########
cpp/src/arrow/record_batch.h:
##########
@@ -243,6 +243,9 @@ class ARROW_EXPORT RecordBatchReader {
return batch;
}
+ /// \brief finalize reader
+ virtual Status Close() = 0;
Review Comment:
Instead of making this pure virtual (`= 0`) can you make this virtual and
give it an implementation?
```suggestion
virtual Status Close() {
return Status::OK();
};
```
##########
cpp/src/arrow/dataset/scanner.cc:
##########
@@ -85,6 +85,8 @@ class ScannerRecordBatchReader : public RecordBatchReader {
return Status::OK();
}
+ Status Close() override { return Status::OK(); }
Review Comment:
We should execute exec plans until they finish. So this should look
something like...
```
Status Close() override {
std::shared_ptr<RecordBatch> batch;
RETURN_NOT_OK(ReadNext(&batch));
while (batch != nullptr) {
RETURN_NOT_OK(ReadNext(&batch));
}
return Status::OK();
}
```
##########
cpp/src/arrow/compute/exec/exec_plan.cc:
##########
@@ -476,6 +476,8 @@ std::shared_ptr<RecordBatchReader> MakeGeneratorReader(
return Status::OK();
}
+ Status Close() override { return Status::OK(); }
Review Comment:
This should read from the generator until the end is reached.
--
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]