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

Method ImportBinaryView

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

Source from the content-addressed store, hash-verified

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