| 420 | /// \brief Append a whole dense array to the builder |
| 421 | template <typename T1 = T> |
| 422 | enable_if_t<!is_fixed_size_binary_type<T1>::value, Status> AppendArray( |
| 423 | const Array& array) { |
| 424 | using ArrayType = typename TypeTraits<T>::ArrayType; |
| 425 | |
| 426 | #ifndef NDEBUG |
| 427 | ARROW_RETURN_NOT_OK(ArrayBuilder::CheckArrayType( |
| 428 | value_type_, array, "Wrong value type of array to be appended")); |
| 429 | #endif |
| 430 | |
| 431 | const auto& concrete_array = static_cast<const ArrayType&>(array); |
| 432 | for (int64_t i = 0; i < array.length(); i++) { |
| 433 | if (array.IsNull(i)) { |
| 434 | ARROW_RETURN_NOT_OK(AppendNull()); |
| 435 | } else { |
| 436 | ARROW_RETURN_NOT_OK(Append(concrete_array.GetView(i))); |
| 437 | } |
| 438 | } |
| 439 | return Status::OK(); |
| 440 | } |
| 441 | |
| 442 | template <typename T1 = T> |
| 443 | enable_if_fixed_size_binary<T1, Status> AppendArray(const Array& array) { |