| 208 | : PrimitiveConverter(pool, type), converter_(pool, repr_type()) {} |
| 209 | |
| 210 | Status Convert(const std::shared_ptr<Array>& in, std::shared_ptr<Array>* out) override { |
| 211 | if (in->type_id() == Type::NA) { |
| 212 | return MakeArrayOfNull(out_type_, in->length(), pool_).Value(out); |
| 213 | } |
| 214 | |
| 215 | std::shared_ptr<Array> repr; |
| 216 | RETURN_NOT_OK(converter_.Convert(in, &repr)); |
| 217 | |
| 218 | auto out_data = repr->data()->Copy(); |
| 219 | out_data->type = out_type_; |
| 220 | *out = MakeArray(out_data); |
| 221 | |
| 222 | return Status::OK(); |
| 223 | } |
| 224 | |
| 225 | private: |
| 226 | using ReprType = typename CTypeTraits<typename DateTimeType::c_type>::ArrowType; |