Skip to main content

ColumnMeta

Struct ColumnMeta 

Source
pub struct ColumnMeta {
    pub name: String,
    pub data_type: u8,
    pub role: u8,
    pub default_encoding: u8,
    pub stats: ColumnStats,
    pub bloom_filter: Option<Vec<u8>>,
    pub encrypted: bool,
    pub key_id: Option<String>,
    pub decimal_scale: Option<u8>,
    pub row_group_blooms: Option<Vec<Vec<u8>>>,
}
Expand description

Metadata for a single column within a segment.

§Segment-level statistics

The stats field stores aggregate statistics across all row groups: min_value, max_value, null_count, value_count, sum, and distinct_count. These are computed by the segment writer during encoding and merged via merge_stats(). Query-time code can use these to prune entire segments without reading row-group data.

Metadata is kept proportional to the data: no fixed-size sketches or histograms, which cost ~49 KiB per segment however little it holds, and which the planner does not need — distinct_count above is exact.

Fields§

§name: String

Column name.

§data_type: u8

Column data type tag (maps to ColumnType).

§role: u8

Column role tag: 0 = timestamp, 1 = tag, 2 = field.

§default_encoding: u8

The encoding the writer intended for this column, chosen from the column’s type before any data was seen.

This is a hint only. The adaptive selector may fall back to a different codec per block (e.g. Chimp → Gorilla → plain), so the authoritative encoding for reading is always ColumnBlockMeta::encoding. The field was previously named encoding, which read as a statement of fact; nothing decodes from it, but the name invited that mistake.

§stats: ColumnStats

Global statistics across all row groups (min, max, null_count, value_count, sum, distinct_count). Enables segment-level pruning at query time.

§bloom_filter: Option<Vec<u8>>

Bloom filter for tag columns.

Contains the serialized bloom filter bit array for tag columns, enabling segment-level predicate pushdown: if a queried tag value is definitely not in the bloom filter, the segment can be skipped. None for non-tag columns, and for segments written before per-tag row-group blooms existed.

§encrypted: bool

Whether this column is encrypted at rest (field-level encryption).

When true, all column blocks for this column are AES-256-GCM encrypted and key_id identifies the encryption key. Statistics (min/max/sum/distinct) are zeroed to prevent leakage.

§key_id: Option<String>

Encryption key ID for this column. Used by the reader to look up the decryption key from a FieldKeyProvider.

§decimal_scale: Option<u8>

Digits after the decimal point, for a decimal column.

None for every other type. The scale lives here, once per column, rather than beside each value: it is a property of the column, fixed when the column was created, and the write path rescales every value to it before the memtable ever sees it. Storing it per value would cost a byte a row to say the same thing 65 536 times, and would make a segment whose rows disagreed representable.

§row_group_blooms: Option<Vec<Vec<u8>>>

Per-row-group bloom filters for string columns .

row_group_blooms[rg_idx] is a serialized bloom filter containing all distinct string values for this column in that row group. Enables row-group-level predicate pushdown: if a queried value is definitely not in the bloom filter, the row group can be skipped. None for non-string columns, encrypted columns, or segments written before .

Implementations§

Source§

impl ColumnMeta

Source

pub fn arrow_data_type(&self) -> DataType

The Arrow type this column decodes to.

The single answer to a question four places in the reader used to answer separately, each ending in _ => DataType::Utf8. That fallback was fine while every non-numeric column was a string; it silently turned a decimal column into Utf8 the moment one existed.

Source

pub fn empty_array(&self) -> ArrayRef

An empty array of this column’s Arrow type, for a pruned row group.

Source

pub fn arrow_field(&self) -> Field

The Arrow field for this column, carrying its role as metadata.

Trait Implementations§

Source§

impl Clone for ColumnMeta

Source§

fn clone(&self) -> ColumnMeta

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ColumnMeta

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ColumnMeta

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ColumnMeta

Source§

fn eq(&self, other: &ColumnMeta) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ColumnMeta

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ColumnMeta

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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