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

Method ImportBinaryView

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

InvalidFunction · 0.50
OKFunction · 0.50
ToStringMethod · 0.45

Tested by

no test coverage detected