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

Method Init

cpp/src/parquet/column_writer.cc:170–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168LevelEncoder::~LevelEncoder() {}
169
170void LevelEncoder::Init(Encoding::type encoding, int16_t max_level,
171 int num_buffered_values, uint8_t* data, int data_size) {
172 bit_width_ = bit_util::Log2(max_level + 1);
173 encoding_ = encoding;
174 switch (encoding) {
175 case Encoding::RLE: {
176 rle_encoder_ = std::make_unique<RleBitPackedEncoder>(data, data_size, bit_width_);
177 break;
178 }
179 case Encoding::BIT_PACKED: {
180 int num_bytes =
181 static_cast<int>(bit_util::BytesForBits(num_buffered_values * bit_width_));
182 bit_packed_encoder_ = std::make_unique<BitWriter>(data, num_bytes);
183 break;
184 }
185 default:
186 throw ParquetException("Unknown encoding type for levels.");
187 }
188}
189
190int LevelEncoder::MaxBufferSize(Encoding::type encoding, int16_t max_level,
191 int num_buffered_values) {

Callers 1

RleEncodeLevelsMethod · 0.45

Calls 3

BytesForBitsFunction · 0.85
ParquetExceptionFunction · 0.85
Log2Function · 0.50

Tested by

no test coverage detected