| 832 | } |
| 833 | |
| 834 | Status Finalize(KernelContext*, Datum* out) override { |
| 835 | const auto& struct_type = checked_cast<const StructType&>(*out_type); |
| 836 | const auto& child_type = struct_type.field(0)->type(); |
| 837 | |
| 838 | std::vector<std::shared_ptr<Scalar>> values; |
| 839 | // Physical type != result type |
| 840 | if ((state.has_nulls && !options.skip_nulls) || (this->count < options.min_count)) { |
| 841 | // (null, null) |
| 842 | auto null_scalar = MakeNullScalar(child_type); |
| 843 | values = {null_scalar, null_scalar}; |
| 844 | } else { |
| 845 | ARROW_ASSIGN_OR_RAISE(auto min_scalar, |
| 846 | MakeScalar(child_type, std::move(state.min))); |
| 847 | ARROW_ASSIGN_OR_RAISE(auto max_scalar, |
| 848 | MakeScalar(child_type, std::move(state.max))); |
| 849 | values = {std::move(min_scalar), std::move(max_scalar)}; |
| 850 | } |
| 851 | out->value = std::make_shared<StructScalar>(std::move(values), this->out_type); |
| 852 | return Status::OK(); |
| 853 | } |
| 854 | |
| 855 | std::shared_ptr<DataType> out_type; |
| 856 | ScalarAggregateOptions options; |
nothing calls this directly
no test coverage detected