rtpsw commented on code in PR #35953:
URL: https://github.com/apache/arrow/pull/35953#discussion_r1220237885


##########
cpp/src/arrow/acero/exec_plan.cc:
##########
@@ -997,9 +1001,11 @@ struct BatchConverter {
   AsyncGenerator<std::optional<ExecBatch>> exec_batch_gen;
   std::shared_ptr<Schema> schema;
   std::shared_ptr<ExecPlan> exec_plan;
+  StopSource stop_source;
+  StopToken stop_token = stop_source.token();
 };
 
-Result<AsyncGenerator<std::shared_ptr<RecordBatch>>> 
DeclarationToRecordBatchGenerator(
+Result<std::shared_ptr<BatchConverter>> DeclarationToBatchConverter(

Review Comment:
   [The batch 
converter](https://github.com/apache/arrow/pull/35953/files#diff-70e843181eb977ed11ad131f79a0f54a0bf9e30a0cb752d440658ee0cc16cc34R947)
 is mainly responsible for [converting exec-batches to 
record-batches](https://github.com/apache/arrow/pull/35953/files#diff-70e843181eb977ed11ad131f79a0f54a0bf9e30a0cb752d440658ee0cc16cc34R965).
 We change the (note: internal) API here because [this new 
`IterateGenerator`-invoking 
code-branch](https://github.com/apache/arrow/pull/35953/files#diff-70e843181eb977ed11ad131f79a0f54a0bf9e30a0cb752d440658ee0cc16cc34R1048-R1049),
 which is specific for the `use_threads=false` case, needs access to 
`make_gen`, which in turn needs access to the batch converter. With this 
refactoring, it turned out that `DeclarationToBatchConverter` was the only API 
needed, so it replaced `DeclarationToRecordBatchGenerator`, and the generator 
was constructed on top of it.



-- 
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]

Reply via email to