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

Method LoadCommon

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

Source from the content-addressed store, hash-verified

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