Skip to main content

Column

Trait Column 

Source
pub trait Column: Send + Sync {
Show 13 methods // Required methods fn column_type(&self) -> &Type; fn size(&self) -> usize; fn clear(&mut self); fn reserve(&mut self, new_cap: usize); fn append_column(&mut self, other: ColumnRef) -> Result<()>; fn load_from_buffer( &mut self, buffer: &mut &[u8], rows: usize, ) -> Result<()>; fn save_to_buffer(&self, buffer: &mut BytesMut) -> Result<()>; fn clone_empty(&self) -> ColumnRef; fn slice(&self, begin: usize, len: usize) -> Result<ColumnRef>; fn as_any(&self) -> &dyn Any; fn as_any_mut(&mut self) -> &mut dyn Any; // Provided methods fn load_prefix(&mut self, _buffer: &mut &[u8], _rows: usize) -> Result<()> { ... } fn save_prefix(&self, _buffer: &mut BytesMut) -> Result<()> { ... }
}
Expand description

Base trait for all column types Note: We use byte buffers instead of generic readers/writers to make the trait dyn-compatible

Required Methods§

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_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

Provided Methods§

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.

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.

Implementors§