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///
5/// The variant set is the closed set of physical column encodings, so a
6/// reader matches it exhaustively and the compiler names every site an added
7/// encoding must handle.
8#[derive(Debug)]
9pub enum DecodedColumn {
10    Int64 {
11        values: Vec<i64>,
12        valid: Vec<bool>,
13    },
14    Float64 {
15        values: Vec<f64>,
16        valid: Vec<bool>,
17    },
18    Timestamp {
19        values: Vec<i64>,
20        valid: Vec<bool>,
21    },
22    Bool {
23        values: Vec<bool>,
24        valid: Vec<bool>,
25    },
26    /// Variable-length or fixed-size binary (String, Bytes, Geometry, Decimal, Uuid, Vector).
27    Binary {
28        /// Raw decompressed bytes for the block.
29        data: Vec<u8>,
30        /// Per-row byte offsets into `data`. Length = row_count + 1.
31        offsets: Vec<u32>,
32        valid: Vec<bool>,
33    },
34    /// Dictionary-encoded string column.
35    ///
36    /// IDs index into `dictionary`. Use `dictionary[ids[i]]` to recover the string
37    /// for row `i` when `valid[i]` is true.
38    DictEncoded {
39        /// Symbol IDs per row (index into `dictionary`).
40        ids: Vec<u32>,
41        /// Dictionary: ID → string value. Populated from `ColumnMeta.dictionary`.
42        dictionary: Vec<String>,
43        valid: Vec<bool>,
44    },
45}