| 399 | } |
| 400 | |
| 401 | Result<Datum> Finalize() override { |
| 402 | // aggregation for group is valid if there was at least one value in that group |
| 403 | ARROW_ASSIGN_OR_RAISE(auto null_bitmap, has_values_.Finish()); |
| 404 | |
| 405 | if (!options_.skip_nulls) { |
| 406 | // ... and there were no nulls in that group |
| 407 | ARROW_ASSIGN_OR_RAISE(auto has_nulls, has_nulls_.Finish()); |
| 408 | arrow::internal::BitmapAndNot(null_bitmap->data(), 0, has_nulls->data(), 0, |
| 409 | num_groups_, 0, null_bitmap->mutable_data()); |
| 410 | } |
| 411 | |
| 412 | auto mins = ArrayData::Make(type_, num_groups_, {null_bitmap, nullptr}); |
| 413 | auto maxes = ArrayData::Make(type_, num_groups_, {std::move(null_bitmap), nullptr}); |
| 414 | ARROW_ASSIGN_OR_RAISE(mins->buffers[1], mins_.Finish()); |
| 415 | ARROW_ASSIGN_OR_RAISE(maxes->buffers[1], maxes_.Finish()); |
| 416 | |
| 417 | return ArrayData::Make(out_type(), num_groups_, {nullptr}, |
| 418 | {std::move(mins), std::move(maxes)}); |
| 419 | } |
| 420 | |
| 421 | std::shared_ptr<DataType> out_type() const override { |
| 422 | return struct_({field("min", type_), field("max", type_)}); |
nothing calls this directly
no test coverage detected