Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine Pitrou <[email protected]>
  • Loading branch information
paleolimbot and pitrou authored Sep 12, 2022
1 parent c99fd56 commit 77be58b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions r/src/compute-exec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ExecPlanReader : public arrow::RecordBatchReader {
arrow::AsyncGenerator<arrow::util::optional<compute::ExecBatch>> sink_gen)
: schema_(schema), plan_(plan), sink_gen_(sink_gen), status_(PLAN_NOT_STARTED) {}

std::string PlanStatus() {
std::string PlanStatus() const {
switch (status_) {
case PLAN_NOT_STARTED:
return "PLAN_NOT_STARTED";
Expand All @@ -88,9 +88,9 @@ class ExecPlanReader : public arrow::RecordBatchReader {
}
}

std::shared_ptr<arrow::Schema> schema() const { return schema_; }
std::shared_ptr<arrow::Schema> schema() const override { return schema_; }

arrow::Status ReadNext(std::shared_ptr<arrow::RecordBatch>* batch_out) {
arrow::Status ReadNext(std::shared_ptr<arrow::RecordBatch>* batch_out) override {
// TODO(ARROW-11841) check a StopToken to potentially cancel this plan

// If this is the first batch getting pulled, tell the exec plan to
Expand Down Expand Up @@ -126,12 +126,12 @@ class ExecPlanReader : public arrow::RecordBatchReader {
return arrow::Status::OK();
}

arrow::Status Close() {
arrow::Status Close() override {
StopProducing();
return arrow::Status::OK();
}

const std::shared_ptr<arrow::compute::ExecPlan>& Plan() { return plan_; }
const std::shared_ptr<arrow::compute::ExecPlan>& Plan() const { return plan_; }

~ExecPlanReader() { StopProducing(); }

Expand Down
6 changes: 3 additions & 3 deletions r/src/recordbatchreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ class RecordBatchReaderHead : public arrow::RecordBatchReader {
int64_t num_rows)
: schema_(reader->schema()), reader_(reader), num_rows_(num_rows) {}

std::shared_ptr<arrow::Schema> schema() const { return schema_; }
std::shared_ptr<arrow::Schema> schema() const override { return schema_; }

arrow::Status ReadNext(std::shared_ptr<arrow::RecordBatch>* batch_out) {
arrow::Status ReadNext(std::shared_ptr<arrow::RecordBatch>* batch_out) override {
if (!reader_) {
// Close() has been called
batch_out = nullptr;
Expand Down Expand Up @@ -160,7 +160,7 @@ class RecordBatchReaderHead : public arrow::RecordBatchReader {
return arrow::Status::OK();
}

arrow::Status Close() {
arrow::Status Close() override {
if (reader_) {
arrow::Status result = reader_->Close();
reader_.reset();
Expand Down

0 comments on commit 77be58b

Please sign in to comment.