Struct lance_encoding::format::pb::List
source · pub struct List {
pub offsets: Option<Box<ArrayEncoding>>,
}Expand description
An array encoding for variable-length list fields
Fields§
§offsets: Option<Box<ArrayEncoding>>An array containing the offsets into an items array.
This array will have (num_rows + 1), will have a data type of uint64, and will never have nulls.
offsets[0] will always be 0.
If the incoming list at index i is not null then offsets[i+1] will contain offsets[i] + len(list)
If the incoming list at index i is null then offsets[i+1] will contain offsets[i] + num_items
The length of the list at index i can then be found from the calculation (offsets[i+1] - offsets[i]) % num_items. If the length is 0 the list is:
- offsets[i+1] == offsets[i] -> empty list
- offsets[i+1] == num_items + offsets[i+1] -> null list
The offsets array is always a uint64 array (even if the arrow type it maps to is using int32 or int64 offsets). However, this array is an unsigned integer array with range [0, 2 * num_items] and so it should be bit packed accordingly.
Trait Implementations§
source§impl Message for List
impl Message for List
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self.source§impl Name for List
impl Name for List
source§const NAME: &'static str = "List"
const NAME: &'static str = "List"
Message.
This name is the same as it appears in the source .proto file, e.g. FooBar.source§const PACKAGE: &'static str = "lance.encodings"
const PACKAGE: &'static str = "lance.encodings"
., e.g. google.protobuf.source§fn full_name() -> String
fn full_name() -> String
Message.
It’s prefixed with the package name and names of any parent messages,
e.g. google.rpc.BadRequest.FieldViolation.
By default, this is the package name followed by the message name.
Fully-qualified names must be unique within a domain of Type URLs.source§impl PartialEq for List
impl PartialEq for List
impl StructuralPartialEq for List
Auto Trait Implementations§
impl Freeze for List
impl RefUnwindSafe for List
impl Send for List
impl Sync for List
impl Unpin for List
impl UnwindSafe for List
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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