Struct lance_file::format::pb::Field
source · pub struct Field {
pub type: i32,
pub name: String,
pub id: i32,
pub parent_id: i32,
pub logical_type: String,
pub nullable: bool,
pub encoding: i32,
pub dictionary: Option<Dictionary>,
pub extension_name: String,
pub metadata: HashMap<String, Vec<u8>>,
}Expand description
Field metadata for a column.
Fields§
§type: i32§name: StringFully qualified name.
id: i32/ Field Id.
/
/ See the comment in DataFile.fields for how field ids are assigned.
parent_id: i32/ Parent Field ID. If not set, this is a top-level column.
logical_type: StringLogical types, support parameterized Arrow Type.
PARENT types will always have logical type “struct”.
REPEATED types may have logical types:
- “list”
- “large_list”
- “list.struct”
- “large_list.struct” The final two are used if the list values are structs, and therefore the field is both implicitly REPEATED and PARENT.
LEAF types may have logical types:
- “null”
- “bool”
- “int8” / “uint8”
- “int16” / “uint16”
- “int32” / “uint32”
- “int64” / “uint64”
- “halffloat” / “float” / “double”
- “string” / “large_string”
- “binary” / “large_binary”
- “date32:day”
- “date64:ms”
- “decimal:128:{precision}:{scale}” / “decimal:256:{precision}:{scale}”
- “time:{unit}” / “timestamp:{unit}” / “duration:{unit}”, where unit is “s”, “ms”, “us”, “ns”
- “dict:{value_type}:{index_type}:false”
nullable: boolIf this field is nullable.
encoding: i32§dictionary: Option<Dictionary>/ The file offset for storing the dictionary value. / It is only valid if encoding is DICTIONARY. / / The logic type presents the value type of the column, i.e., string value.
extension_name: StringDeprecated: optional extension type name, use metadata field ARROW:extension:name
metadata: HashMap<String, Vec<u8>>optional field metadata (e.g. extension type name/parameters)
Implementations§
source§impl Field
impl Field
sourcepub fn type(&self) -> Type
pub fn type(&self) -> Type
Returns the enum value of type, or the default if the field is set to an invalid enum value.
sourcepub fn encoding(&self) -> Encoding
pub fn encoding(&self) -> Encoding
Returns the enum value of encoding, or the default if the field is set to an invalid enum value.
sourcepub fn set_encoding(&mut self, value: Encoding)
pub fn set_encoding(&mut self, value: Encoding)
Sets encoding to the provided enum value.
Trait Implementations§
source§impl Message for Field
impl Message for Field
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.