Crystrix commented on a change in pull request #12369:
URL: https://github.com/apache/arrow/pull/12369#discussion_r801791649



##########
File path: cpp/src/arrow/compute/kernels/hash_aggregate.cc
##########
@@ -2541,27 +2541,33 @@ Result<Datum> GroupBy(const std::vector<Datum>& 
arguments, const std::vector<Dat
           ? 
arrow::internal::TaskGroup::MakeThreaded(arrow::internal::GetCpuThreadPool())
           : arrow::internal::TaskGroup::MakeSerial();
 
-  // Construct and initialize HashAggregateKernels
-  ARROW_ASSIGN_OR_RAISE(auto argument_descrs,
-                        ExecBatch::Make(arguments).Map(
-                            [](ExecBatch batch) { return 
batch.GetDescriptors(); }));
+  std::vector<const HashAggregateKernel*> kernels;
+  std::vector<std::vector<std::unique_ptr<KernelState>>> states;
+  FieldVector out_fields;
 
-  ARROW_ASSIGN_OR_RAISE(auto kernels, GetKernels(ctx, aggregates, 
argument_descrs));
+  using arrow::compute::detail::ExecBatchIterator;
+  std::unique_ptr<ExecBatchIterator> argument_batch_iterator;
 
-  std::vector<std::vector<std::unique_ptr<KernelState>>> states(
-      task_group->parallelism());
-  for (auto& state : states) {
-    ARROW_ASSIGN_OR_RAISE(state, InitKernels(kernels, ctx, aggregates, 
argument_descrs));
-  }
+  if (!arguments.empty()) {

Review comment:
       Init arguments related variables only if arguments exists




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