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

Method GetBuffer

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

Source from the content-addressed store, hash-verified

250 }
251
252 Status GetBuffer(int buffer_index, std::shared_ptr<Buffer>* out) {
253 auto* buffers = metadata_->buffers();
254 CHECK_FLATBUFFERS_NOT_NULL(buffers, "RecordBatch.buffers");
255 if (buffer_index >= static_cast<int>(buffers->size())) {
256 return Status::IOError("buffer_index out of range.");
257 }
258 const flatbuf::Buffer* buffer = buffers->Get(buffer_index);
259 if (buffer->length() == 0) {
260 // Should never return a null buffer here.
261 // (zero-sized buffer allocations are cheap)
262 return AllocateBuffer(0).Value(out);
263 } else {
264 return ReadBuffer(buffer->offset(), buffer->length(), out);
265 }
266 }
267
268 Result<int64_t> GetVariadicCount(int i) {
269 auto* variadic_counts = metadata_->variadicBufferCounts();

Callers 11

ToArrayDataMethod · 0.45
AllNullShortCircuitMethod · 0.45
PropagateSingleMethod · 0.45
ExecIntoArrayDataMethod · 0.45
scalar_validity.ccFile · 0.45
ExecMethod · 0.45
ExecMethod · 0.45
ExecMethod · 0.45
StringDataTransformFunction · 0.45

Calls 8

IOErrorFunction · 0.85
buffersMethod · 0.80
AllocateBufferFunction · 0.50
sizeMethod · 0.45
GetMethod · 0.45
lengthMethod · 0.45
ValueMethod · 0.45
offsetMethod · 0.45

Tested by

no test coverage detected