| 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 | |
| 178 | template <typename ArgType, typename CumulativeState, typename OptionsType> |
nothing calls this directly
no test coverage detected