pub enum ColumnData {
Int64 {
values: Arc<Vec<i64>>,
nulls: Arc<Vec<bool>>,
},
Float64 {
values: Arc<Vec<f64>>,
nulls: Arc<Vec<bool>>,
},
String {
values: Arc<Vec<Arc<str>>>,
nulls: Arc<Vec<bool>>,
},
Bool {
values: Arc<Vec<bool>>,
nulls: Arc<Vec<bool>>,
},
Date {
values: Arc<Vec<Date>>,
nulls: Arc<Vec<bool>>,
},
Time {
values: Arc<Vec<Time>>,
nulls: Arc<Vec<bool>>,
},
Timestamp {
values: Arc<Vec<Timestamp>>,
nulls: Arc<Vec<bool>>,
},
Interval {
values: Arc<Vec<Interval>>,
nulls: Arc<Vec<bool>>,
},
Vector {
values: Arc<Vec<Vec<f32>>>,
nulls: Arc<Vec<bool>>,
},
Blob {
values: Arc<Vec<Vec<u8>>>,
nulls: Arc<Vec<bool>>,
},
}Expand description
Typed column data with NULL bitmap
Each variant stores a vector of non-NULL values and a separate bitmap indicating which positions are NULL. This design:
- Avoids Option
overhead (16 bytes vs 8 bytes for f64) - Enables direct SIMD operations on value vectors
- Provides O(1) NULL checks via bitmap
- Uses Arc for zero-copy sharing with executor layer
- String columns use Arc
for O(1) cloning
Variants§
Int64
64-bit signed integers
Float64
64-bit floating point
String
Variable-length strings (using Arc
Bool
Boolean values
Date
Date values
Time
Time values
Timestamp
Timestamp values
Interval
Interval values
Vector
Vector values (for AI/ML workloads)
Blob
Blob values (binary data)
Implementations§
Source§impl ColumnData
impl ColumnData
Sourcepub fn size_in_bytes(&self) -> usize
pub fn size_in_bytes(&self) -> usize
Estimate the memory size of this column in bytes
This is used for memory budgeting in the columnar cache. The estimate includes:
- Value storage (type-specific size * element count)
- NULL bitmap (1 byte per element, not packed)
- Vec overhead (capacity, length, pointer)
Sourcepub fn get(&self, index: usize) -> SqlValue
pub fn get(&self, index: usize) -> SqlValue
Get the SQL value at the given index (converts back to SqlValue)
Sourcepub fn as_i64_arc(&self) -> Option<(&Arc<Vec<i64>>, &Arc<Vec<bool>>)>
pub fn as_i64_arc(&self) -> Option<(&Arc<Vec<i64>>, &Arc<Vec<bool>>)>
Get the underlying Arc for i64 values (zero-copy sharing with executor)
Sourcepub fn as_f64_arc(&self) -> Option<(&Arc<Vec<f64>>, &Arc<Vec<bool>>)>
pub fn as_f64_arc(&self) -> Option<(&Arc<Vec<f64>>, &Arc<Vec<bool>>)>
Get the underlying Arc for f64 values (zero-copy sharing with executor)
Sourcepub fn as_string_arc(&self) -> Option<(&Arc<Vec<Arc<str>>>, &Arc<Vec<bool>>)>
pub fn as_string_arc(&self) -> Option<(&Arc<Vec<Arc<str>>>, &Arc<Vec<bool>>)>
Get the underlying Arc for string values (zero-copy sharing with executor)
Sourcepub fn as_bool_arc(&self) -> Option<(&Arc<Vec<bool>>, &Arc<Vec<bool>>)>
pub fn as_bool_arc(&self) -> Option<(&Arc<Vec<bool>>, &Arc<Vec<bool>>)>
Get the underlying Arc for bool values (zero-copy sharing with executor)
Sourcepub fn as_date_arc(&self) -> Option<(&Arc<Vec<Date>>, &Arc<Vec<bool>>)>
pub fn as_date_arc(&self) -> Option<(&Arc<Vec<Date>>, &Arc<Vec<bool>>)>
Get the underlying Arc for date values (zero-copy sharing with executor)
Sourcepub fn as_timestamp_arc(
&self,
) -> Option<(&Arc<Vec<Timestamp>>, &Arc<Vec<bool>>)>
pub fn as_timestamp_arc( &self, ) -> Option<(&Arc<Vec<Timestamp>>, &Arc<Vec<bool>>)>
Get the underlying Arc for timestamp values (zero-copy sharing with executor)
Trait Implementations§
Source§impl Clone for ColumnData
impl Clone for ColumnData
Source§fn clone(&self) -> ColumnData
fn clone(&self) -> ColumnData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more