| 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); |
no test coverage detected