pub struct EncodedStream {
pub meta: StreamMeta,
pub data: EncodedStreamData,
}Expand description
Owned variant of RawStream.
Fields§
§meta: StreamMeta§data: EncodedStreamDataImplementations§
Source§impl EncodedStream
impl EncodedStream
pub fn as_borrowed(&self) -> RawStream<'_>
Source§impl EncodedStream
impl EncodedStream
Sourcepub fn empty_without_encoding() -> Self
pub fn empty_without_encoding() -> Self
Creates an empty stream
Sourcepub fn encode_bools(values: &[bool]) -> MltResult<Self>
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.
Sourcepub fn encode_presence(values: &[bool]) -> MltResult<Self>
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
Sourcepub fn encode_f32(values: &[f32]) -> MltResult<Self>
pub fn encode_f32(values: &[f32]) -> MltResult<Self>
Encodes f32s into a stream
Sourcepub fn encode_f64(values: &[f64]) -> MltResult<Self>
pub fn encode_f64(values: &[f64]) -> MltResult<Self>
Encodes f64s into a stream
pub fn encode_i8s(values: &[i8], encoding: IntEncoder) -> MltResult<Self>
pub fn encode_u8s(values: &[u8], encoding: IntEncoder) -> MltResult<Self>
pub fn encode_i32s(values: &[i32], encoding: IntEncoder) -> MltResult<Self>
pub fn encode_u32s(values: &[u32], encoding: IntEncoder) -> MltResult<Self>
pub fn encode_u32s_of_type( values: &[u32], encoding: IntEncoder, stream_type: StreamType, ) -> MltResult<Self>
pub fn encode_i64s(values: &[i64], encoding: IntEncoder) -> MltResult<Self>
pub fn encode_u64s(values: &[u64], encoding: IntEncoder) -> MltResult<Self>
Sourcepub fn encode_strings_with_type<S: AsRef<str>>(
values: &[S],
length_encoding: IntEncoder,
length_type: LengthType,
dict_type: DictionaryType,
) -> MltResult<EncodedStringsEncoding>
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.
Sourcepub fn encode_strings_fsst_with_type<S: AsRef<str>>(
values: &[S],
encoding: FsstStrEncoder,
dict_type: DictionaryType,
) -> MltResult<EncodedStringsEncoding>
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:
- Symbol lengths stream (Length,
LengthType::Symbol) - Symbol table data stream (Data,
DictionaryType::Fsst) - Value lengths stream (Length,
LengthType::Dictionary) - Compressed corpus stream (Data,
dict_type) - 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.
Sourcepub fn encode_strings_fsst_plain_with_type<S: AsRef<str>>(
values: &[S],
encoding: FsstStrEncoder,
dict_type: DictionaryType,
) -> MltResult<EncodedStringsEncoding>
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
impl Analyze for EncodedStream
Source§fn for_each_stream(&self, cb: &mut dyn FnMut(StreamMeta))
fn for_each_stream(&self, cb: &mut dyn FnMut(StreamMeta))
cb with the StreamMeta of every stream contained in self.
Default implementation is a no-op (types that hold no streams).fn collect_statistic(&self, _stat: StatType) -> usize
Source§impl Clone for EncodedStream
impl Clone for EncodedStream
Source§fn clone(&self) -> EncodedStream
fn clone(&self) -> EncodedStream
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more