Skip to main content

ColumnDate

Struct ColumnDate 

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

Column for Date type (stored as UInt16 - days since Unix epoch 1970-01-01)

Range: 1970-01-01 to 2149-06-06

ClickHouse Reference: https://clickhouse.com/docs/en/sql-reference/data-types/date

C++ Implementation Pattern: Uses delegation to ColumnUInt16 for storage, matching the C++ clickhouse-cpp reference implementation’s std::shared_ptr<ColumnUInt16> data_ pattern.

Implementations§

Source§

impl ColumnDate

Source

pub fn new(type_: Type) -> Self

Creates a new empty Date column with the given type.

Source

pub fn with_data(self, data: Vec<u16>) -> Self

Returns a new column populated with the given days-since-epoch values.

Source

pub fn append(&mut self, days: u16)

Append days since epoch (raw UInt16 value)

Source

pub fn append_timestamp(&mut self, timestamp: i64)

Append from Unix timestamp (seconds since epoch)

Source

pub fn at(&self, index: usize) -> u16

Get raw days value at index

Source

pub fn timestamp_at(&self, index: usize) -> i64

Get Unix timestamp (seconds) at index

Source

pub fn len(&self) -> usize

Returns the number of elements in the column.

Source

pub fn is_empty(&self) -> bool

Returns true if the column contains no elements.

Source

pub fn data(&self) -> &ColumnUInt16

Get reference to underlying data column (for advanced use)

Trait Implementations§

Source§

impl Column for ColumnDate

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

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