Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-33643: [C++] Remove implicit = capture of this which is not valid in c++20 #33644

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions cpp/src/arrow/compute/exec/source_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,24 @@ struct SourceNode : ExecNode {
bit_util::CeilDiv(morsel_length, ExecPlan::kMaxBatchSize));
batch_count_ += num_batches;
}
RETURN_NOT_OK(plan_->query_context()->ScheduleTask([=]() {
int64_t offset = 0;
do {
int64_t batch_size = std::min<int64_t>(
morsel_length - offset, ExecPlan::kMaxBatchSize);
// In order for the legacy batching model to work we must
// not slice batches from the source
if (use_legacy_batching) {
batch_size = morsel_length;
}
ExecBatch batch = morsel.Slice(offset, batch_size);
offset += batch_size;
outputs_[0]->InputReceived(this, std::move(batch));
} while (offset < morsel.length);
return Status::OK();
}));
RETURN_NOT_OK(plan_->query_context()->ScheduleTask(
[this, morsel = std::move(morsel), morsel_length,
use_legacy_batching]() {
int64_t offset = 0;
do {
int64_t batch_size = std::min<int64_t>(
morsel_length - offset, ExecPlan::kMaxBatchSize);
// In order for the legacy batching model to work we must
// not slice batches from the source
if (use_legacy_batching) {
batch_size = morsel_length;
}
ExecBatch batch = morsel.Slice(offset, batch_size);
offset += batch_size;
outputs_[0]->InputReceived(this, std::move(batch));
} while (offset < morsel.length);
return Status::OK();
}));
lock.lock();
if (!backpressure_future_.is_finished()) {
EVENT(span_, "Source paused due to backpressure");
Expand Down