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

Method DeltaBitPackEncoder

cpp/src/parquet/encoder.cc:1052–1083  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1050 using TypedEncoder<DType>::Put;
1051
1052 explicit DeltaBitPackEncoder(const ColumnDescriptor* descr, MemoryPool* pool,
1053 const uint32_t values_per_block = kValuesPerBlock,
1054 const uint32_t mini_blocks_per_block = kMiniBlocksPerBlock)
1055 : EncoderImpl(descr, Encoding::DELTA_BINARY_PACKED, pool),
1056 values_per_block_(values_per_block),
1057 mini_blocks_per_block_(mini_blocks_per_block),
1058 values_per_mini_block_(values_per_block / mini_blocks_per_block),
1059 deltas_(values_per_block, ::arrow::stl::allocator<T>(pool)),
1060 bits_buffer_(
1061 AllocateBuffer(pool, (kMiniBlocksPerBlock + values_per_block) * sizeof(T))),
1062 sink_(pool),
1063 bit_writer_(bits_buffer_->mutable_data(),
1064 static_cast<int>(bits_buffer_->size())) {
1065 if (values_per_block_ % 128 != 0) {
1066 throw ParquetException(
1067 "the number of values in a block must be multiple of 128, but it's " +
1068 std::to_string(values_per_block_));
1069 }
1070 if (values_per_mini_block_ % 32 != 0) {
1071 throw ParquetException(
1072 "the number of values in a miniblock must be multiple of 32, but it's " +
1073 std::to_string(values_per_mini_block_));
1074 }
1075 if (values_per_block % mini_blocks_per_block != 0) {
1076 throw ParquetException(
1077 "the number of values per block % number of miniblocks per block must be 0, "
1078 "but it's " +
1079 std::to_string(values_per_block % mini_blocks_per_block));
1080 }
1081 // Reserve enough space at the beginning of the buffer for largest possible header.
1082 PARQUET_THROW_NOT_OK(sink_.Advance(kMaxPageHeaderWriterSize));
1083 }
1084
1085 std::shared_ptr<Buffer> FlushValues() override;
1086

Callers

nothing calls this directly

Calls 6

ParquetExceptionFunction · 0.85
to_stringFunction · 0.85
AllocateBufferFunction · 0.70
mutable_dataMethod · 0.45
sizeMethod · 0.45
AdvanceMethod · 0.45

Tested by

no test coverage detected