| 372 | } |
| 373 | |
| 374 | Status AppendArraySlice(const ArraySpan& array, int64_t offset, int64_t length) final { |
| 375 | // Visit the indices and insert the unpacked values. |
| 376 | const auto& dict_ty = internal::checked_cast<const DictionaryType&>(*array.type); |
| 377 | // See if possible to avoid using ToArrayData here |
| 378 | const typename TypeTraits<T>::ArrayType dict(array.dictionary().ToArrayData()); |
| 379 | ARROW_RETURN_NOT_OK(Reserve(length)); |
| 380 | switch (dict_ty.index_type()->id()) { |
| 381 | case Type::UINT8: |
| 382 | return AppendArraySliceImpl<uint8_t>(dict, array, offset, length); |
| 383 | case Type::INT8: |
| 384 | return AppendArraySliceImpl<int8_t>(dict, array, offset, length); |
| 385 | case Type::UINT16: |
| 386 | return AppendArraySliceImpl<uint16_t>(dict, array, offset, length); |
| 387 | case Type::INT16: |
| 388 | return AppendArraySliceImpl<int16_t>(dict, array, offset, length); |
| 389 | case Type::UINT32: |
| 390 | return AppendArraySliceImpl<uint32_t>(dict, array, offset, length); |
| 391 | case Type::INT32: |
| 392 | return AppendArraySliceImpl<int32_t>(dict, array, offset, length); |
| 393 | case Type::UINT64: |
| 394 | return AppendArraySliceImpl<uint64_t>(dict, array, offset, length); |
| 395 | case Type::INT64: |
| 396 | return AppendArraySliceImpl<int64_t>(dict, array, offset, length); |
| 397 | default: |
| 398 | return Status::TypeError("Invalid index type: ", dict_ty); |
| 399 | } |
| 400 | return Status::OK(); |
| 401 | } |
| 402 | |
| 403 | /// \brief Insert values into the dictionary's memo, but do not append any |
| 404 | /// indices. Can be used to initialize a new builder with known dictionary |
nothing calls this directly
no test coverage detected