| 73 | |
| 74 | template <parquet::Encoding::type ENCODING> |
| 75 | inline bool ParquetBoolDecoder::DecodeValue(bool* RESTRICT value) RESTRICT { |
| 76 | DCHECK_EQ(ENCODING, encoding_); |
| 77 | if (LIKELY(unpacked_value_idx_ < num_unpacked_values_)) { |
| 78 | *value = unpacked_values_[unpacked_value_idx_++]; |
| 79 | } else { |
| 80 | // Unpack as many values as we can into the buffer. We expect to read at least one |
| 81 | // value. |
| 82 | if (ENCODING == parquet::Encoding::PLAIN) { |
| 83 | num_unpacked_values_ = |
| 84 | bool_values_.UnpackBatch(1, UNPACKED_BUFFER_LEN, &unpacked_values_[0]); |
| 85 | } else { |
| 86 | num_unpacked_values_ = |
| 87 | rle_decoder_.GetValues(UNPACKED_BUFFER_LEN, &unpacked_values_[0]); |
| 88 | } |
| 89 | |
| 90 | if (UNLIKELY(num_unpacked_values_ == 0)) { |
| 91 | return false; |
| 92 | } |
| 93 | *value = unpacked_values_[0]; |
| 94 | unpacked_value_idx_ = 1; |
| 95 | } |
| 96 | return true; |
| 97 | } |
| 98 | } // namespace impala |
nothing calls this directly
no test coverage detected