Skip to main content

ColumnNullable

Struct ColumnNullable 

Source
pub struct ColumnNullable { /* private fields */ }
Expand description

Column for nullable values

Stores a nested column and a ColumnUInt8 for null flags (1 = null, 0 = not null).

Wire Format:

[null_bitmap: UInt8 * num_rows][nested_column_data]

ClickHouse Reference:

Implementations§

Source§

impl ColumnNullable

Source

pub fn new(type_: Type) -> Self

Create a new nullable column from a nullable type

Source

pub fn with_nested(nested: ColumnRef) -> Self

Create a new nullable column wrapping an existing nested column

Source

pub fn from_parts(nested: ColumnRef, nulls: ColumnRef) -> Result<Self>

Create with both nested and nulls columns

Source

pub fn with_capacity(type_: Type, capacity: usize) -> Self

Create with reserved capacity

Source

pub fn append(&mut self, isnull: bool)

Append a null flag (matches C++ API)

Source

pub fn append_null(&mut self)

Append a null value

Source

pub fn append_non_null(&mut self)

Append a non-null value (the nested column should be updated separately)

Source

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

Check if value at index is null (matches C++ IsNull)

Source

pub fn nested<T: Column + 'static>(&self) -> &T

Get a reference to the nested column as a specific type

§Example
let col: ColumnNullable = /* ... */;
let nested: &ColumnUInt32 = col.nested();
Source

pub fn nested_mut<T: Column + 'static>(&mut self) -> &mut T

Get mutable reference to the nested column as a specific type

§Example
let mut col: ColumnNullable = /* ... */;
let nested_mut: &mut ColumnUInt32 = col.nested_mut();
Source

pub fn nested_ref(&self) -> ColumnRef

Get the nested column as a ColumnRef (Arc<dyn Column>)

Source

pub fn nested_ref_mut(&mut self) -> &mut ColumnRef

Get mutable access to the nested ColumnRef for dynamic dispatch scenarios

This is useful when you need to modify the nested column but don’t know its concrete type at compile time.

Source

pub fn nulls(&self) -> ColumnRef

Get the nulls column (matches C++ Nulls)

Source

pub fn append_nullable(&mut self, value: Option<u32>)

Append a nullable UInt32 value (convenience method for tests)

Source

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

Check if value at index is null (alias for is_null)

Source

pub fn at(&self, _index: usize) -> ColumnRef

Get a reference to the value at the given index Returns the nested column for accessing the value (check is_null first!)

Source

pub fn len(&self) -> usize

Get the number of elements (alias for size())

Source

pub fn is_empty(&self) -> bool

Check if the nullable column is empty

Trait Implementations§

Source§

impl Clone for ColumnNullable

Source§

fn clone(&self) -> Self

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 Column for ColumnNullable

Source§

fn column_type(&self) -> &Type

Get the type of this column
Source§

fn size(&self) -> usize

Get the number of rows in this column
Source§

fn clear(&mut self)

Clear all data from the column
Source§

fn reserve(&mut self, new_cap: usize)

Reserve capacity for at least new_cap elements
Source§

fn append_column(&mut self, other: ColumnRef) -> Result<()>

Append another column’s data to this column
Source§

fn load_from_buffer(&mut self, buffer: &mut &[u8], rows: usize) -> Result<()>

Load column data from byte buffer
Source§

fn save_prefix(&self, buffer: &mut BytesMut) -> Result<()>

Save column prefix to byte buffer (for types that need prefix data) Default implementation is a no-op. Override for types like LowCardinality, Array with special nested types. This matches C++ clickhouse-cpp’s SavePrefix pattern.
Source§

fn save_to_buffer(&self, buffer: &mut BytesMut) -> Result<()>

Save column data to byte buffer
Source§

fn clone_empty(&self) -> ColumnRef

Create an empty clone of this column (same type, no data)
Source§

fn slice(&self, begin: usize, len: usize) -> Result<ColumnRef>

Create a slice of this column
Source§

fn as_any(&self) -> &dyn Any

Downcast to a concrete column type
Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Downcast to a mutable concrete column type
Source§

fn load_prefix(&mut self, _buffer: &mut &[u8], _rows: usize) -> Result<()>

Load column prefix from byte buffer (for types that need prefix data) Default implementation is a no-op. Override for types like LowCardinality. This matches C++ clickhouse-cpp’s LoadPrefix pattern.

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more