Produce an Array of index/offset views from a std::vector of index/offset BinaryViewType::c_type
| 372 | // Produce an Array of index/offset views from a std::vector of index/offset |
| 373 | // BinaryViewType::c_type |
| 374 | Result<std::shared_ptr<StringViewArray>> MakeBinaryViewArray( |
| 375 | BufferVector data_buffers, const std::vector<BinaryViewType::c_type>& views, |
| 376 | bool validate = true) { |
| 377 | auto length = static_cast<int64_t>(views.size()); |
| 378 | auto arr = std::make_shared<StringViewArray>( |
| 379 | utf8_view(), length, Buffer::FromVector(views), std::move(data_buffers)); |
| 380 | if (validate) { |
| 381 | RETURN_NOT_OK(arr->ValidateFull()); |
| 382 | } |
| 383 | return arr; |
| 384 | } |
| 385 | |
| 386 | TEST(StringViewArray, Validate) { |
| 387 | // Since this is a test of validation, we need to be able to construct invalid arrays. |
no test coverage detected