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

Method InputReceived

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

Source from the content-addressed store, hash-verified

369}
370
371Status GroupByNode::InputReceived(ExecNode* input, ExecBatch batch) {
372 auto scope = TraceInputReceived(batch);
373
374 DCHECK_EQ(input, inputs_[0]);
375
376 auto handler = [this](const ExecBatch& full_batch, const Segment& segment) {
377 if (!segment.extends && segment.offset == 0)
378 RETURN_NOT_OK(OutputResult(/*is_last=*/false));
379 auto exec_batch = full_batch.Slice(segment.offset, segment.length);
380 auto batch = ExecSpan(exec_batch);
381 RETURN_NOT_OK(Consume(batch));
382 RETURN_NOT_OK(
383 ExtractSegmenterValues(&segmenter_values_, exec_batch, segment_key_field_ids_));
384 if (!segment.is_open) RETURN_NOT_OK(OutputResult(/*is_last=*/false));
385 return Status::OK();
386 };
387 ARROW_RETURN_NOT_OK(
388 HandleSegments(segmenter_.get(), batch, segment_key_field_ids_, handler));
389
390 if (input_counter_.Increment()) {
391 ARROW_RETURN_NOT_OK(OutputResult(/*is_last=*/true));
392 }
393 return Status::OK();
394}
395
396Status GroupByNode::InputFinished(ExecNode* input, int total_batches) {
397 auto scope = TraceFinish();

Callers 1

OutputNthBatchMethod · 0.45

Calls 7

ConsumeFunction · 0.85
ExtractSegmenterValuesFunction · 0.85
HandleSegmentsFunction · 0.85
ExecSpanFunction · 0.50
OKFunction · 0.50
SliceMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected