pub struct StructField {
pub name: String,
pub data_type: DataType,
pub nullable: bool,
pub metadata: HashMap<String, MetadataValue>,
}
Fields§
§name: String
Name of this (possibly nested) column
data_type: DataType
The data type of this field
nullable: bool
Denotes whether this Field can be null
metadata: HashMap<String, MetadataValue>
A JSON map containing information about this column
Implementations§
Source§impl StructField
impl StructField
Sourcepub fn new(
name: impl Into<String>,
data_type: impl Into<DataType>,
nullable: bool,
) -> StructField
pub fn new( name: impl Into<String>, data_type: impl Into<DataType>, nullable: bool, ) -> StructField
Creates a new field
pub fn with_metadata( self, metadata: impl IntoIterator<Item = (impl Into<String>, impl Into<MetadataValue>)>, ) -> StructField
pub fn get_config_value( &self, key: &ColumnMetadataKey, ) -> Option<&MetadataValue>
Sourcepub fn physical_name(
&self,
mapping_mode: ColumnMappingMode,
) -> Result<&str, Error>
pub fn physical_name( &self, mapping_mode: ColumnMappingMode, ) -> Result<&str, Error>
Get the physical name for this field as it should be read from parquet, based on the specified column mapping mode.
Sourcepub fn with_name(&self, new_name: impl Into<String>) -> StructField
pub fn with_name(&self, new_name: impl Into<String>) -> StructField
Change the name of a field. The field will preserve its data type and nullability. Note that this allocates a new field.
pub fn name(&self) -> &String
pub fn is_nullable(&self) -> bool
pub const fn data_type(&self) -> &DataType
pub const fn metadata(&self) -> &HashMap<String, MetadataValue>
Sourcepub fn metadata_with_string_values(&self) -> HashMap<String, String>
pub fn metadata_with_string_values(&self) -> HashMap<String, String>
Convert our metadata into a HashMap<String, String>. Note this copies all the data so can be expensive for large metadata
pub fn make_physical( &self, mapping_mode: ColumnMappingMode, ) -> Result<StructField, Error>
Trait Implementations§
Source§impl Clone for StructField
impl Clone for StructField
Source§fn clone(&self) -> StructField
fn clone(&self) -> StructField
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StructField
impl Debug for StructField
Source§impl<'de> Deserialize<'de> for StructField
impl<'de> Deserialize<'de> for StructField
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StructField, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StructField, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StructField
impl PartialEq for StructField
Source§impl Serialize for StructField
impl Serialize for StructField
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<&Field> for StructField
impl TryFrom<&Field> for StructField
Source§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
Source§fn try_from(arrow_field: &Field) -> Result<StructField, ArrowError>
fn try_from(arrow_field: &Field) -> Result<StructField, ArrowError>
Performs the conversion.
impl Eq for StructField
impl StructuralPartialEq for StructField
Auto Trait Implementations§
impl Freeze for StructField
impl RefUnwindSafe for StructField
impl Send for StructField
impl Sync for StructField
impl Unpin for StructField
impl UnwindSafe for StructField
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Converts
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>
Converts
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