| 1509 | |
| 1510 | template <typename ReserveFunc, typename AppendValuesFunc> |
| 1511 | int DecodeArrowInternal(int num_values, int null_count, const uint8_t* valid_bits, |
| 1512 | int64_t valid_bits_offset, ReserveFunc&& reserve_func, |
| 1513 | AppendValuesFunc&& append_values_func) { |
| 1514 | if (null_count != 0) { |
| 1515 | // TODO(ARROW-34660): implement DecodeArrow with null slots. |
| 1516 | ParquetException::NYI("Delta bit pack DecodeArrow with null slots"); |
| 1517 | } |
| 1518 | reserve_func(num_values); |
| 1519 | constexpr int kBatchSize = 1024; |
| 1520 | std::array<T, kBatchSize> values; |
| 1521 | int offset = 0; |
| 1522 | while (offset < num_values) { |
| 1523 | const int batch_size = std::min(num_values - offset, kBatchSize); |
| 1524 | int decoded_count = GetInternal(values.data(), batch_size); |
| 1525 | if (decoded_count != batch_size) { |
| 1526 | ParquetException::EofException("Not enough values in data page"); |
| 1527 | } |
| 1528 | append_values_func(values.data(), batch_size); |
| 1529 | offset += batch_size; |
| 1530 | } |
| 1531 | return num_values; |
| 1532 | } |
| 1533 | |
| 1534 | void InitHeader() { |
| 1535 | if (!decoder_->GetVlqInt(&values_per_block_) || |