MCPcopy Create free account
hub / github.com/apache/arrow / OutputResult

Method OutputResult

cpp/src/arrow/acero/groupby_aggregate_node.cc:344–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344Status GroupByNode::OutputResult(bool is_last) {
345 // To simplify merging, ensure that the first grouper is nonempty
346 for (size_t i = 0; i < local_states_.size(); i++) {
347 if (local_states_[i].grouper) {
348 std::swap(local_states_[i], local_states_[0]);
349 break;
350 }
351 }
352
353 RETURN_NOT_OK(Merge());
354 ARROW_ASSIGN_OR_RAISE(out_data_, Finalize());
355
356 int64_t num_output_batches = bit_util::CeilDiv(out_data_.length, output_batch_size());
357 total_output_batches_ += static_cast<int>(num_output_batches);
358 if (is_last) {
359 ARROW_RETURN_NOT_OK(output_->InputFinished(this, total_output_batches_));
360 RETURN_NOT_OK(plan_->query_context()->StartTaskGroup(output_task_group_id_,
361 num_output_batches));
362 } else {
363 for (int64_t i = 0; i < num_output_batches; i++) {
364 ARROW_RETURN_NOT_OK(OutputNthBatch(i));
365 }
366 ARROW_RETURN_NOT_OK(ResetKernelStates());
367 }
368 return Status::OK();
369}
370
371Status GroupByNode::InputReceived(ExecNode* input, ExecBatch batch) {
372 auto scope = TraceInputReceived(batch);

Callers

nothing calls this directly

Calls 10

swapFunction · 0.85
MergeFunction · 0.85
FinalizeFunction · 0.85
CeilDivFunction · 0.85
query_contextMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.70
OKFunction · 0.50
sizeMethod · 0.45
InputFinishedMethod · 0.45
StartTaskGroupMethod · 0.45

Tested by

no test coverage detected