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

Method LoadCommon

cpp/src/arrow/ipc/reader.cc:302–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300 }
301
302 Status LoadCommon(Type::type type_id, bool allow_validity_bitmap = true) {
303 DCHECK_NE(out_, nullptr);
304 // This only contains the length and null count, which we need to figure
305 // out what to do with the buffers. For example, if null_count == 0, then
306 // we can skip that buffer without reading from shared memory
307 RETURN_NOT_OK(GetFieldMetadata(field_index_++, out_));
308
309 if (::arrow::internal::has_variadic_buffers(type_id)) {
310 ARROW_ASSIGN_OR_RAISE(auto data_buffer_count,
311 GetVariadicCount(variadic_count_index_++));
312 const int64_t start = static_cast<int64_t>(out_->buffers.size());
313 // NOTE: this must be done before any other call to `GetBuffer` because
314 // BatchDataReadRequest will keep pointers to `std::shared_ptr<Buffer>`
315 // objects.
316 out_->buffers.resize(start + data_buffer_count);
317 }
318
319 if (internal::HasValidityBitmap(type_id, metadata_version_)) {
320 // Extract null bitmap which is common to all arrays except for unions
321 // and nulls.
322 if (out_->null_count != 0) {
323 if (allow_validity_bitmap) {
324 RETURN_NOT_OK(GetBuffer(buffer_index_, &out_->buffers[0]));
325 } else {
326 // Caller did not allow this
327 return Status::Invalid("Cannot read ", ::arrow::internal::ToTypeName(type_id),
328 " array with top-level validity bitmap");
329 }
330 }
331 buffer_index_++;
332 }
333
334 return Status::OK();
335 }
336
337 template <typename TYPE>
338 Status LoadPrimitive(Type::type type_id) {

Callers

nothing calls this directly

Calls 9

GetFieldMetadataFunction · 0.85
has_variadic_buffersFunction · 0.85
GetBufferFunction · 0.85
ToTypeNameFunction · 0.85
resizeMethod · 0.80
HasValidityBitmapFunction · 0.70
InvalidFunction · 0.50
OKFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected