Skip to main content

to_dictionary_codes

Function to_dictionary_codes 

Source
pub fn to_dictionary_codes(
    column_meta: &ColumnChunkMetadata,
    chunk: Buffer<u8>,
    field_name: &str,
    filter: Option<Filter>,
    accept: impl FnOnce(usize, usize, usize) -> bool,
) -> Result<Option<(Vec<DictionaryArray<u32>>, Bitmap)>, PolarsError>
Available on crate feature polars-io only.
Expand description

Decodes a flat String column chunk as codes into its dictionary, if it has a dictionary page, every data page is dictionary-encoded and accept(num_rows, dict_len, dict_bytes) holds for the number of rows the filter keeps (all of the chunk’s for a predicate, whose result isn’t known yet) and the number and uncompressed size of the dictionary values. Returns None otherwise, without decoding anything.