You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/02 19:36:00 UTC

[GitHub] [arrow] pitrou commented on a diff in pull request #14571: ARROW-18206: [C++][CI] Add a nightly build for C++20 compilation

pitrou commented on code in PR #14571:
URL: https://github.com/apache/arrow/pull/14571#discussion_r1012218196


##########
cpp/src/arrow/compute/exec/source_node.cc:
##########
@@ -131,22 +131,23 @@ struct SourceNode : ExecNode {
                              bit_util::CeilDiv(morsel_length, ExecPlan::kMaxBatchSize));
                          batch_count_ += num_batches;
                        }
-                       RETURN_NOT_OK(plan_->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_->ScheduleTask(

Review Comment:
   This cascade of nested callbacks is not the most readable code, except perhaps for Lisp fans...



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org