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

Method GetBatch

cpp/src/arrow/util/rle_encoding_internal.h:332–342  ·  view source on GitHub ↗

Get a batch of values return the number of decoded elements. May write fewer elements to the output than requested if there are not enough values left.

Source from the content-addressed store, hash-verified

330 /// May write fewer elements to the output than requested if there are not enough values
331 /// left.
332 [[nodiscard]] rle_size_t GetBatch(value_type* out, rle_size_t batch_size,
333 rle_size_t value_bit_width) {
334 if (ARROW_PREDICT_FALSE(remaining_count_ == 0)) {
335 return 0;
336 }
337
338 const auto to_read = std::min(remaining_count_, batch_size);
339 std::fill(out, out + to_read, value_);
340 remaining_count_ -= to_read;
341 return to_read;
342 }
343
344 private:
345 value_type value_ = {};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected