| 1581 | } |
| 1582 | |
| 1583 | void InitHeader() { |
| 1584 | if (!decoder_->GetVlqInt(&values_per_block_) || |
| 1585 | !decoder_->GetVlqInt(&mini_blocks_per_block_) || |
| 1586 | !decoder_->GetVlqInt(&total_value_count_) || |
| 1587 | !decoder_->GetZigZagVlqInt(&last_value_)) { |
| 1588 | ParquetException::EofException("InitHeader EOF"); |
| 1589 | } |
| 1590 | |
| 1591 | if (values_per_block_ == 0) { |
| 1592 | throw ParquetException("cannot have zero value per block"); |
| 1593 | } |
| 1594 | if (values_per_block_ % 128 != 0) { |
| 1595 | throw ParquetException( |
| 1596 | "the number of values in a block must be multiple of 128, but it's " + |
| 1597 | std::to_string(values_per_block_)); |
| 1598 | } |
| 1599 | if (mini_blocks_per_block_ == 0) { |
| 1600 | throw ParquetException("cannot have zero miniblock per block"); |
| 1601 | } |
| 1602 | values_per_mini_block_ = values_per_block_ / mini_blocks_per_block_; |
| 1603 | if (values_per_mini_block_ == 0) { |
| 1604 | throw ParquetException("cannot have zero value per miniblock"); |
| 1605 | } |
| 1606 | if (values_per_mini_block_ % 32 != 0) { |
| 1607 | throw ParquetException( |
| 1608 | "the number of values in a miniblock must be multiple of 32, but it's " + |
| 1609 | std::to_string(values_per_mini_block_)); |
| 1610 | } |
| 1611 | |
| 1612 | total_values_remaining_ = total_value_count_; |
| 1613 | if (delta_bit_widths_ == nullptr) { |
| 1614 | delta_bit_widths_ = AllocateBuffer(pool_, mini_blocks_per_block_); |
| 1615 | } else { |
| 1616 | PARQUET_THROW_NOT_OK( |
| 1617 | delta_bit_widths_->Resize(mini_blocks_per_block_, /*shrink_to_fit*/ false)); |
| 1618 | } |
| 1619 | first_block_initialized_ = false; |
| 1620 | values_remaining_current_mini_block_ = 0; |
| 1621 | } |
| 1622 | |
| 1623 | void InitBlock() { |
| 1624 | DCHECK_GT(total_values_remaining_, 0) << "InitBlock called at EOF"; |
nothing calls this directly
no test coverage detected