| 93 | } |
| 94 | |
| 95 | Status Finalize(KernelContext*, Datum* out) override { |
| 96 | if ((!options.skip_nulls && this->nulls_observed) || |
| 97 | (this->count < options.min_count)) { |
| 98 | out->value = std::make_shared<OutputType>(this->out_type); |
| 99 | } else { |
| 100 | out->value = std::make_shared<OutputType>(this->sum, this->out_type); |
| 101 | } |
| 102 | return Status::OK(); |
| 103 | } |
| 104 | |
| 105 | size_t count = 0; |
| 106 | bool nulls_observed = false; |