| 123 | } |
| 124 | |
| 125 | Status MergeFrom(KernelContext*, KernelState&& src) override { |
| 126 | const auto& other_state = checked_cast<const PivotImpl&>(src); |
| 127 | for (int64_t key = 0; key < static_cast<int64_t>(values_.size()); ++key) { |
| 128 | if (other_state.values_[key]->is_valid) { |
| 129 | if (ARROW_PREDICT_FALSE(values_[key]->is_valid)) { |
| 130 | return DuplicateValue(); |
| 131 | } |
| 132 | values_[key] = other_state.values_[key]; |
| 133 | } |
| 134 | } |
| 135 | return Status::OK(); |
| 136 | } |
| 137 | |
| 138 | Status Finalize(KernelContext* ctx, Datum* out) override { |
| 139 | *out = std::make_shared<StructScalar>(std::move(values_), out_type_); |