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

Method InitHeader

cpp/src/parquet/decoder.cc:1534–1572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1532 }
1533
1534 void InitHeader() {
1535 if (!decoder_->GetVlqInt(&values_per_block_) ||
1536 !decoder_->GetVlqInt(&mini_blocks_per_block_) ||
1537 !decoder_->GetVlqInt(&total_value_count_) ||
1538 !decoder_->GetZigZagVlqInt(&last_value_)) {
1539 ParquetException::EofException("InitHeader EOF");
1540 }
1541
1542 if (values_per_block_ == 0) {
1543 throw ParquetException("cannot have zero value per block");
1544 }
1545 if (values_per_block_ % 128 != 0) {
1546 throw ParquetException(
1547 "the number of values in a block must be multiple of 128, but it's " +
1548 std::to_string(values_per_block_));
1549 }
1550 if (mini_blocks_per_block_ == 0) {
1551 throw ParquetException("cannot have zero miniblock per block");
1552 }
1553 values_per_mini_block_ = values_per_block_ / mini_blocks_per_block_;
1554 if (values_per_mini_block_ == 0) {
1555 throw ParquetException("cannot have zero value per miniblock");
1556 }
1557 if (values_per_mini_block_ % 32 != 0) {
1558 throw ParquetException(
1559 "the number of values in a miniblock must be multiple of 32, but it's " +
1560 std::to_string(values_per_mini_block_));
1561 }
1562
1563 total_values_remaining_ = total_value_count_;
1564 if (delta_bit_widths_ == nullptr) {
1565 delta_bit_widths_ = AllocateBuffer(pool_, mini_blocks_per_block_);
1566 } else {
1567 PARQUET_THROW_NOT_OK(
1568 delta_bit_widths_->Resize(mini_blocks_per_block_, /*shrink_to_fit*/ false));
1569 }
1570 first_block_initialized_ = false;
1571 values_remaining_current_mini_block_ = 0;
1572 }
1573
1574 void InitBlock() {
1575 DCHECK_GT(total_values_remaining_, 0) << "InitBlock called at EOF";

Callers

nothing calls this directly

Calls 6

ParquetExceptionFunction · 0.85
to_stringFunction · 0.85
GetVlqIntMethod · 0.80
GetZigZagVlqIntMethod · 0.80
AllocateBufferFunction · 0.70
ResizeMethod · 0.45

Tested by

no test coverage detected