Skip to main content

EncodedStream

Struct EncodedStream 

Source
pub struct EncodedStream {
    pub meta: StreamMeta,
    pub data: EncodedStreamData,
}
Expand description

Owned variant of RawStream.

Fields§

§meta: StreamMeta§data: EncodedStreamData

Implementations§

Source§

impl EncodedStream

Source

pub fn as_borrowed(&self) -> RawStream<'_>

Source§

impl EncodedStream

Source

pub fn empty_without_encoding() -> Self

Creates an empty stream

Source

pub fn encode_bools(values: &[bool]) -> MltResult<Self>

Encode a boolean data stream: byte-RLE <- packed bitmap <- Vec<bool> Boolean streams always use byte-RLE encoding with LogicalEncoding::Rle metadata. The RleMeta values are computed by readers from the stream itself.

Source

pub fn encode_presence(values: &[bool]) -> MltResult<Self>

Encode a presence/nullability stream

Identical to Self::encode_bools except the stream type is StreamType::Present

Source

pub fn encode_f32(values: &[f32]) -> MltResult<Self>

Encodes f32s into a stream

Source

pub fn encode_f64(values: &[f64]) -> MltResult<Self>

Encodes f64s into a stream

Source

pub fn encode_i8s(values: &[i8], encoding: IntEncoder) -> MltResult<Self>

Source

pub fn encode_u8s(values: &[u8], encoding: IntEncoder) -> MltResult<Self>

Source

pub fn encode_i32s(values: &[i32], encoding: IntEncoder) -> MltResult<Self>

Source

pub fn encode_u32s(values: &[u32], encoding: IntEncoder) -> MltResult<Self>

Source

pub fn encode_u32s_of_type( values: &[u32], encoding: IntEncoder, stream_type: StreamType, ) -> MltResult<Self>

Source

pub fn encode_i64s(values: &[i64], encoding: IntEncoder) -> MltResult<Self>

Source

pub fn encode_u64s(values: &[u64], encoding: IntEncoder) -> MltResult<Self>

Source

pub fn encode_strings_with_type<S: AsRef<str>>( values: &[S], length_encoding: IntEncoder, length_type: LengthType, dict_type: DictionaryType, ) -> MltResult<EncodedStringsEncoding>

Encode a sequence of strings into a length stream and a data stream.

Source

pub fn encode_strings_fsst_with_type<S: AsRef<str>>( values: &[S], encoding: FsstStrEncoder, dict_type: DictionaryType, ) -> MltResult<EncodedStringsEncoding>

Encode a sequence of strings using FSST compression.

Produces 5 streams:

  1. Symbol lengths stream (Length, LengthType::Symbol)
  2. Symbol table data stream (Data, DictionaryType::Fsst)
  3. Value lengths stream (Length, LengthType::Dictionary)
  4. Compressed corpus stream (Data, dict_type)
  5. Offset indices stream (Offset, OffsetType::String)

The dictionary type of the compressed corpus stream is determined by the dict_type argument passed to this function.

Note: The FSST algorithm implementation may differ from Java’s, so the compressed output may not be byte-for-byte identical. Both implementations are semantically compatible and can decode each other’s output.

Source

pub fn encode_strings_fsst_plain_with_type<S: AsRef<str>>( values: &[S], encoding: FsstStrEncoder, dict_type: DictionaryType, ) -> MltResult<EncodedStringsEncoding>

Encode strings with FSST (4 streams, no offset). For shared dictionary struct columns; each child has its own offset stream.

Trait Implementations§

Source§

impl Analyze for EncodedStream

Source§

fn for_each_stream(&self, cb: &mut dyn FnMut(StreamMeta))

Call cb with the StreamMeta of every stream contained in self. Default implementation is a no-op (types that hold no streams).
Source§

fn collect_statistic(&self, _stat: StatType) -> usize

Source§

impl Clone for EncodedStream

Source§

fn clone(&self) -> EncodedStream

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 EncodedStream

Source§

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

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

impl PartialEq for EncodedStream

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for EncodedStream

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