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

Method WriteIndices

cpp/src/parquet/encoder.cc:478–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476 int dict_encoded_size() const override { return dict_encoded_size_; }
477
478 int WriteIndices(uint8_t* buffer, int buffer_len) override {
479 // Write bit width in first byte
480 *buffer = static_cast<uint8_t>(bit_width());
481 ++buffer;
482 --buffer_len;
483
484 ::arrow::util::RleBitPackedEncoder encoder(buffer, buffer_len, bit_width());
485
486 for (int32_t index : buffered_indices_) {
487 if (ARROW_PREDICT_FALSE(!encoder.Put(index))) return -1;
488 }
489 encoder.Flush();
490
491 ClearIndices();
492 return kDataPageBitWidthBytes + encoder.len();
493 }
494
495 /// Returns a conservative estimate of the number of bytes needed to encode the buffered
496 /// indices. Used to size the buffer passed to WriteIndices().

Callers 1

DecodeDictFunction · 0.45

Calls 4

bit_widthFunction · 0.50
PutMethod · 0.45
FlushMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected