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

Method GetListViewSizes

cpp/src/arrow/ipc/writer.cc:433–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431
432 template <typename ArrayType, typename offset_type = typename ArrayType::offset_type>
433 Status GetListViewSizes(const ArrayType& array,
434 std::shared_ptr<Buffer>* out_value_sizes) {
435 const int64_t required_bytes = sizeof(offset_type) * array.length();
436 auto sizes = array.value_sizes();
437 if (sizes != nullptr && (array.offset() != 0 || sizes->size() > required_bytes)) {
438 // ARROW-6046: Slice offsets to used extent, in case we have a truncated slice
439 auto offset_bytes = array.offset() * sizeof(offset_type);
440 sizes = SliceBuffer(sizes, offset_bytes, required_bytes);
441 }
442 *out_value_sizes = std::move(sizes);
443 return Status::OK();
444 }
445
446 Status Visit(const BooleanArray& array) {
447 std::shared_ptr<Buffer> data;

Callers

nothing calls this directly

Calls 5

SliceBufferFunction · 0.85
OKFunction · 0.50
lengthMethod · 0.45
offsetMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected