Skip to content

Commit 14ab09e

Browse files
committed
refactor: consistently panic on bool
Panic also in DictFallbackCounter::update_values when the type is bool.
1 parent 87a19c4 commit 14ab09e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

parquet/src/data_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ pub(crate) mod private {
809809
}
810810

811811
fn plain_encoded_size(&self) -> usize {
812-
panic!("Dictionary encoding should not be used for BOOLEAN type")
812+
panic!("dictionary encoding should not be used for BOOLEAN type")
813813
}
814814

815815
#[inline]

parquet/src/encodings/encoding/dict_fallback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ impl DictFallbackCounter {
6666
/// Updates the counter with the given slice of values.
6767
pub fn update_values<T: ParquetValueType>(&mut self, values: &[T]) {
6868
let raw_size = match T::PHYSICAL_TYPE {
69-
Type::BOOLEAN => values.len(),
7069
Type::INT32 | Type::FLOAT => 4 * values.len(),
7170
Type::INT64 | Type::DOUBLE => 8 * values.len(),
7271
Type::INT96 => Int96::SIZE_IN_BYTES * values.len(),
@@ -75,6 +74,7 @@ impl DictFallbackCounter {
7574
values.iter().map(|value| value.plain_encoded_size()).sum()
7675
}
7776
Type::FIXED_LEN_BYTE_ARRAY => self.type_length * values.len(),
77+
Type::BOOLEAN => panic!("dictionary encoding should not be used for BOOLEAN type"),
7878
};
7979
self.raw_data_size = self.raw_data_size.saturating_add(raw_size);
8080
self.num_values += values.len();

0 commit comments

Comments
 (0)