pub struct ROW_ADDR_FIELD { /* private fields */ }
Expand description
Row address field. This is nullable because its validity bitmap is sometimes used as a selection vector.
Methods from Deref<Target = ArrowField>§
pub const LIST_FIELD_DEFAULT_NAME: &'static str = "item"
Sourcepub fn metadata(&self) -> &HashMap<String, String>
pub fn metadata(&self) -> &HashMap<String, String>
Returns the immutable reference to the Field
’s optional custom metadata.
Sourcepub fn extension_type_name(&self) -> Option<&str>
pub fn extension_type_name(&self) -> Option<&str>
Returns the extension type name of this Field
, if set.
This returns the value of EXTENSION_TYPE_NAME_KEY
, if set in
Field::metadata
. If the key is missing, there is no extension type
name and this returns None
.
§Example
let field = Field::new("", DataType::Null, false);
assert_eq!(field.extension_type_name(), None);
let field = Field::new("", DataType::Null, false).with_metadata(
[(EXTENSION_TYPE_NAME_KEY.to_owned(), "example".to_owned())]
.into_iter()
.collect(),
);
assert_eq!(field.extension_type_name(), Some("example"));
Sourcepub fn extension_type_metadata(&self) -> Option<&str>
pub fn extension_type_metadata(&self) -> Option<&str>
Returns the extension type metadata of this Field
, if set.
This returns the value of EXTENSION_TYPE_METADATA_KEY
, if set in
Field::metadata
. If the key is missing, there is no extension type
metadata and this returns None
.
§Example
let field = Field::new("", DataType::Null, false);
assert_eq!(field.extension_type_metadata(), None);
let field = Field::new("", DataType::Null, false).with_metadata(
[(EXTENSION_TYPE_METADATA_KEY.to_owned(), "example".to_owned())]
.into_iter()
.collect(),
);
assert_eq!(field.extension_type_metadata(), Some("example"));
Sourcepub fn try_extension_type<E>(&self) -> Result<E, ArrowError>where
E: ExtensionType,
pub fn try_extension_type<E>(&self) -> Result<E, ArrowError>where
E: ExtensionType,
Returns an instance of the given ExtensionType
of this Field
,
if set in the Field::metadata
.
§Error
Returns an error if
- this field does not have the name of this extension type
(
ExtensionType::NAME
) in theField::metadata
(mismatch or missing) - the deserialization of the metadata
(
ExtensionType::deserialize_metadata
) fails - the construction of the extension type (
ExtensionType::try_new
) fail (for example when theField::data_type
is not supported by the extension type (ExtensionType::supports_data_type
))
Sourcepub fn extension_type<E>(&self) -> Ewhere
E: ExtensionType,
pub fn extension_type<E>(&self) -> Ewhere
E: ExtensionType,
Returns an instance of the given ExtensionType
of this Field
,
panics if this Field
does not have this extension type.
§Panic
This calls Field::try_extension_type
and panics when it returns an
error.
Sourcepub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
Indicates whether this Field
supports null values.
Sourcepub fn dict_id(&self) -> Option<i64>
👎Deprecated since 54.0.0: The ability to preserve dictionary IDs will be removed. With it, all fields related to it.
pub fn dict_id(&self) -> Option<i64>
Returns the dictionary ID, if this is a dictionary type.
Sourcepub fn dict_is_ordered(&self) -> Option<bool>
pub fn dict_is_ordered(&self) -> Option<bool>
Returns whether this Field
’s dictionary is ordered, if this is a dictionary type.
§Example
// non dictionaries do not have a dict is ordered flat
let field = Field::new("c1", DataType::Int64, false);
assert_eq!(field.dict_is_ordered(), None);
// by default dictionary is not ordered
let field = Field::new("c1", DataType::Dictionary(Box::new(DataType::Int64), Box::new(DataType::Utf8)), false);
assert_eq!(field.dict_is_ordered(), Some(false));
let field = field.with_dict_is_ordered(true);
assert_eq!(field.dict_is_ordered(), Some(true));
Trait Implementations§
Source§impl Deref for ROW_ADDR_FIELD
impl Deref for ROW_ADDR_FIELD
impl LazyStatic for ROW_ADDR_FIELD
Auto Trait Implementations§
impl Freeze for ROW_ADDR_FIELD
impl RefUnwindSafe for ROW_ADDR_FIELD
impl Send for ROW_ADDR_FIELD
impl Sync for ROW_ADDR_FIELD
impl Unpin for ROW_ADDR_FIELD
impl UnwindSafe for ROW_ADDR_FIELD
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