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

Method ImportBinaryView

cpp/src/arrow/c/bridge.cc:1764–1784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1762 }
1763
1764 Status ImportBinaryView(const BinaryViewType&) {
1765 RETURN_NOT_OK(CheckNoChildren());
1766 if (c_struct_->n_buffers < 3) {
1767 return Status::Invalid("Expected at least 3 buffers for imported type ",
1768 type_->ToString(), ", ArrowArray struct has ",
1769 c_struct_->n_buffers);
1770 }
1771 RETURN_NOT_OK(AllocateArrayData());
1772 RETURN_NOT_OK(ImportNullBitmap());
1773 RETURN_NOT_OK(ImportFixedSizeBuffer(1, BinaryViewType::kSize));
1774
1775 // The last C data buffer stores buffer sizes, and shouldn't be imported
1776 auto* buffer_sizes =
1777 static_cast<const int64_t*>(c_struct_->buffers[c_struct_->n_buffers - 1]);
1778
1779 for (int32_t buffer_id = 2; buffer_id < c_struct_->n_buffers - 1; ++buffer_id) {
1780 RETURN_NOT_OK(ImportBuffer(buffer_id, buffer_sizes[buffer_id - 2]));
1781 }
1782 data_->buffers.pop_back();
1783 return Status::OK();
1784 }
1785
1786 template <typename StringType>
1787 Status ImportStringLike(const StringType& type) {

Callers

nothing calls this directly

Calls 4

ImportBufferFunction · 0.85
InvalidFunction · 0.50
OKFunction · 0.50
ToStringMethod · 0.45

Tested by

no test coverage detected