bkietz commented on a change in pull request #11032:
URL: https://github.com/apache/arrow/pull/11032#discussion_r728133071



##########
File path: cpp/src/arrow/compute/exec/exec_plan.cc
##########
@@ -402,5 +402,31 @@ ExecFactoryRegistry* default_exec_factory_registry() {
   return &instance;
 }
 
+Result<std::function<Future<util::optional<ExecBatch>>()>> MakeReaderGenerator(
+    std::shared_ptr<RecordBatchReader> reader, ::arrow::internal::Executor* 
io_executor,
+    int max_q, int q_restart) {
+  auto batch_it = MakeMapIterator(
+      [](std::shared_ptr<RecordBatch> batch) {
+        return util::make_optional(ExecBatch(*batch));
+      },
+      MakeIteratorFromReader(reader));
+
+  ARROW_ASSIGN_OR_RAISE(
+      auto batch_gen,
+      MakeBackgroundGenerator(std::move(batch_it), io_executor, max_q, 
q_restart));
+
+  return std::function<Future<util::optional<ExecBatch>>()>([batch_gen] {
+    // TODO(ARROW-14070) Awful workaround for MSVC 19.0 (Visual Studio 2015) 
bug.

Review comment:
       We have removed vs2015, this can be reverted.
   ```diff
   -  ARROW_ASSIGN_OR_RAISE(
   -      auto batch_gen,
   -      MakeBackgroundGenerator(std::move(batch_it), io_executor, max_q, 
q_restart));
   -
   -  return std::function<Future<util::optional<ExecBatch>>()>([batch_gen] {
   -    // TODO(ARROW-14070) Awful workaround for MSVC 19.0 (Visual Studio 
2015) bug.
   -    //...
   +  return MakeBackgroundGenerator(std::move(batch_it), io_executor, max_q, 
q_restart);
   ```

##########
File path: cpp/src/arrow/compute/exec/exec_plan.cc
##########
@@ -402,5 +402,31 @@ ExecFactoryRegistry* default_exec_factory_registry() {
   return &instance;
 }
 
+Result<std::function<Future<util::optional<ExecBatch>>()>> MakeReaderGenerator(
+    std::shared_ptr<RecordBatchReader> reader, ::arrow::internal::Executor* 
io_executor,
+    int max_q, int q_restart) {
+  auto batch_it = MakeMapIterator(
+      [](std::shared_ptr<RecordBatch> batch) {
+        return util::make_optional(ExecBatch(*batch));
+      },
+      MakeIteratorFromReader(reader));
+
+  ARROW_ASSIGN_OR_RAISE(
+      auto batch_gen,
+      MakeBackgroundGenerator(std::move(batch_it), io_executor, max_q, 
q_restart));
+
+  return std::function<Future<util::optional<ExecBatch>>()>([batch_gen] {
+    // TODO(ARROW-14070) Awful workaround for MSVC 19.0 (Visual Studio 2015) 
bug.

Review comment:
       We have removed vs2015, this can be simplified.
   ```diff
   -  ARROW_ASSIGN_OR_RAISE(
   -      auto batch_gen,
   -      MakeBackgroundGenerator(std::move(batch_it), io_executor, max_q, 
q_restart));
   -
   -  return std::function<Future<util::optional<ExecBatch>>()>([batch_gen] {
   -    // TODO(ARROW-14070) Awful workaround for MSVC 19.0 (Visual Studio 
2015) bug.
   -    //...
   +  return MakeBackgroundGenerator(std::move(batch_it), io_executor, max_q, 
q_restart);
   ```




-- 
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-unsubscr...@arrow.apache.org

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


Reply via email to