Skip to main content

nodedb_columnar/reader/
types.rs

1// SPDX-License-Identifier: Apache-2.0
2
3/// Decoded column data from a segment scan.
4#[derive(Debug)]
5#[non_exhaustive]
6pub enum DecodedColumn {
7    Int64 {
8        values: Vec<i64>,
9        valid: Vec<bool>,
10    },
11    Float64 {
12        values: Vec<f64>,
13        valid: Vec<bool>,
14    },
15    Timestamp {
16        values: Vec<i64>,
17        valid: Vec<bool>,
18    },
19    Bool {
20        values: Vec<bool>,
21        valid: Vec<bool>,
22    },
23    /// Variable-length or fixed-size binary (String, Bytes, Geometry, Decimal, Uuid, Vector).
24    Binary {
25        /// Raw decompressed bytes for the block.
26        data: Vec<u8>,
27        /// Per-row byte offsets into `data`. Length = row_count + 1.
28        offsets: Vec<u32>,
29        valid: Vec<bool>,
30    },
31    /// Dictionary-encoded string column.
32    ///
33    /// IDs index into `dictionary`. Use `dictionary[ids[i]]` to recover the string
34    /// for row `i` when `valid[i]` is true.
35    DictEncoded {
36        /// Symbol IDs per row (index into `dictionary`).
37        ids: Vec<u32>,
38        /// Dictionary: ID → string value. Populated from `ColumnMeta.dictionary`.
39        dictionary: Vec<String>,
40        valid: Vec<bool>,
41    },
42}