Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-parquet/src/parquet/encoding/mod.rs
6940 views
1
pub mod bitpacked;
2
pub mod byte_stream_split;
3
pub mod delta_bitpacked;
4
pub mod delta_byte_array;
5
pub mod delta_length_byte_array;
6
pub mod hybrid_rle;
7
pub mod plain_byte_array;
8
pub mod uleb128;
9
pub mod zigzag_leb128;
10
11
pub use crate::parquet::parquet_bridge::Encoding;
12
13
/// # Panics
14
/// This function panics iff `values.len() < 4`.
15
#[inline]
16
pub fn get_length(values: &[u8]) -> Option<usize> {
17
assert!(values.len() >= 4);
18
values
19
.get(0..4)
20
.map(|x| u32::from_le_bytes(x.try_into().unwrap()) as usize)
21
}
22
23
/// Returns the ceil of value / 8
24
#[inline]
25
pub fn ceil8(value: usize) -> usize {
26
value / 8 + (!value.is_multiple_of(8) as usize)
27
}
28
29