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

Method ConsumeImpl

cpp/src/arrow/compute/row/grouper.cc:661–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659 }
660
661 Result<Datum> ConsumeImpl(const ExecSpan& batch, int64_t offset, int64_t length,
662 GrouperMode mode) {
663 ARROW_RETURN_NOT_OK(CheckAndCapLengthForConsume(batch.length, offset, &length));
664 if (offset != 0 || length != batch.length) {
665 auto batch_slice = batch.ToExecBatch().Slice(offset, length);
666 return ConsumeImpl(ExecSpan(batch_slice), 0, -1, mode);
667 }
668 // ARROW-14027: broadcast scalar arguments for now
669 for (int i = 0; i < batch.num_values(); i++) {
670 if (batch[i].is_scalar()) {
671 ExecBatch expanded = batch.ToExecBatch();
672 for (int j = i; j < expanded.num_values(); j++) {
673 if (expanded.values[j].is_scalar()) {
674 ARROW_ASSIGN_OR_RAISE(
675 expanded.values[j],
676 MakeArrayFromScalar(*expanded.values[j].scalar(), expanded.length,
677 ctx_->memory_pool()));
678 }
679 }
680 return ConsumeImpl(ExecSpan(expanded), mode);
681 }
682 }
683 return ConsumeImpl(batch, mode);
684 }
685
686 Result<Datum> ConsumeImpl(const ExecSpan& batch, GrouperMode mode) {
687 int64_t num_rows = batch.length;

Callers

nothing calls this directly

Calls 15

AllocateBitmapFunction · 0.85
bits_to_indexesFunction · 0.85
UInt32ArrayClass · 0.85
is_scalarMethod · 0.80
ToArrayDataMethod · 0.80
CleanMethod · 0.80
PrepareEncodeSelectedMethod · 0.80
early_filterMethod · 0.80
map_new_keysMethod · 0.80
ExecSpanFunction · 0.50
ARROW_ASSIGN_OR_RAISEFunction · 0.50

Tested by

no test coverage detected