MCPcopy Create free account
hub / github.com/apache/arrow / MakeBinaryViewArray

Function MakeBinaryViewArray

cpp/src/arrow/array/array_binary_test.cc:374–384  ·  view source on GitHub ↗

Produce an Array of index/offset views from a std::vector of index/offset BinaryViewType::c_type

Source from the content-addressed store, hash-verified

372// Produce an Array of index/offset views from a std::vector of index/offset
373// BinaryViewType::c_type
374Result<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
386TEST(StringViewArray, Validate) {
387 // Since this is a test of validation, we need to be able to construct invalid arrays.

Callers 1

TESTFunction · 0.85

Calls 3

FromVectorFunction · 0.85
sizeMethod · 0.45
ValidateFullMethod · 0.45

Tested by

no test coverage detected