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

Method Exec

cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc:158–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156 using OutType = typename CumulativeState::OutType;
157 using OutValue = typename GetOutputType<OutType>::T;
158 static Status Exec(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) {
159 const auto& options = CumulativeOptionsWrapper<OptionsType>::Get(ctx);
160 Accumulator<ArgType, CumulativeState> accumulator(ctx);
161 if (options.start.has_value()) {
162 accumulator.current_state = CumulativeState(options.start.value());
163 } else {
164 accumulator.current_state = CumulativeState();
165 }
166 accumulator.skip_nulls = options.skip_nulls;
167
168 RETURN_NOT_OK(accumulator.builder.Reserve(batch.length));
169 RETURN_NOT_OK(accumulator.Accumulate(batch[0].array));
170
171 std::shared_ptr<ArrayData> result;
172 RETURN_NOT_OK(accumulator.builder.FinishInternal(&result));
173 out->value = std::move(result);
174 return Status::OK();
175 }
176};
177
178template <typename ArgType, typename CumulativeState, typename OptionsType>

Callers

nothing calls this directly

Calls 6

AccumulateMethod · 0.80
GetFunction · 0.50
OKFunction · 0.50
valueMethod · 0.45
ReserveMethod · 0.45
FinishInternalMethod · 0.45

Tested by

no test coverage detected