ColumnData

Enum ColumnData 

Source
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

Fields

§values: Arc<Vec<i64>>
§nulls: Arc<Vec<bool>>
§

Float64

64-bit floating point

Fields

§values: Arc<Vec<f64>>
§nulls: Arc<Vec<bool>>
§

String

Variable-length strings (using Arc for O(1) cloning)

Fields

§values: Arc<Vec<Arc<str>>>
§nulls: Arc<Vec<bool>>
§

Bool

Boolean values

Fields

§values: Arc<Vec<bool>>
§nulls: Arc<Vec<bool>>
§

Date

Date values

Fields

§values: Arc<Vec<Date>>
§nulls: Arc<Vec<bool>>
§

Time

Time values

Fields

§values: Arc<Vec<Time>>
§nulls: Arc<Vec<bool>>
§

Timestamp

Timestamp values

Fields

§values: Arc<Vec<Timestamp>>
§nulls: Arc<Vec<bool>>
§

Interval

Interval values

Fields

§values: Arc<Vec<Interval>>
§nulls: Arc<Vec<bool>>
§

Vector

Vector values (for AI/ML workloads)

Fields

§values: Arc<Vec<Vec<f32>>>
§nulls: Arc<Vec<bool>>
§

Blob

Blob values (binary data)

Fields

§values: Arc<Vec<Vec<u8>>>
§nulls: Arc<Vec<bool>>

Implementations§

Source§

impl ColumnData

Source

pub fn len(&self) -> usize

Get the number of values in this column (including NULLs)

Source

pub fn is_empty(&self) -> bool

Check if the column is empty

Source

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)
Source

pub fn is_null(&self, index: usize) -> bool

Check if the value at the given index is NULL

Source

pub fn get(&self, index: usize) -> SqlValue

Get the SQL value at the given index (converts back to SqlValue)

Source

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)

Source

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)

Source

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)

Source

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)

Source

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)

Source

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)

Source

pub fn as_time_arc(&self) -> Option<(&Arc<Vec<Time>>, &Arc<Vec<bool>>)>

Get the underlying Arc for time values (zero-copy sharing with executor)

Source

pub fn as_interval_arc(&self) -> Option<(&Arc<Vec<Interval>>, &Arc<Vec<bool>>)>

Get the underlying Arc for interval values (zero-copy sharing with executor)

Trait Implementations§

Source§

impl Clone for ColumnData

Source§

fn clone(&self) -> ColumnData

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ColumnData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V