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.