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

Method Consume

cpp/src/arrow/compute/kernels/aggregate_basic.cc:101–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 explicit CountImpl(CountOptions options) : options(std::move(options)) {}
100
101 Status Consume(KernelContext*, const ExecSpan& batch) override {
102 if (options.mode == CountOptions::ALL) {
103 this->non_nulls += batch.length;
104 } else if (batch[0].is_array()) {
105 const ArraySpan& input = batch[0].array;
106 const int64_t nulls = input.ComputeLogicalNullCount();
107 this->nulls += nulls;
108 this->non_nulls += input.length - nulls;
109 } else {
110 const Scalar& input = *batch[0].scalar;
111 this->nulls += !input.is_valid * batch.length;
112 this->non_nulls += input.is_valid * batch.length;
113 }
114 return Status::OK();
115 }
116
117 Status MergeFrom(KernelContext*, KernelState&& src) override {
118 const auto& other_state = checked_cast<const CountImpl&>(src);

Callers 1

AggregateConsumeFunction · 0.45

Calls 3

is_arrayMethod · 0.80
OKFunction · 0.50

Tested by

no test coverage detected