pub struct AvroDataType {
nullability: Option<Nullability>,
metadata: HashMap<String, String>,
codec: Codec,
}
Expand description
An Avro datatype mapped to the arrow data model
Fields§
§nullability: Option<Nullability>
§metadata: HashMap<String, String>
§codec: Codec
Implementations§
Source§impl AvroDataType
impl AvroDataType
Sourcepub fn field_with_name(&self, name: &str) -> Field
pub fn field_with_name(&self, name: &str) -> Field
Returns an arrow [Field
] with the given name
Sourcepub fn codec(&self) -> &Codec
pub fn codec(&self) -> &Codec
Returns a reference to the codec used by this data type
The codec determines how Avro data is encoded and mapped to Arrow data types. This is useful when we need to inspect or use the specific encoding of a field.
Sourcepub fn nullability(&self) -> Option<Nullability>
pub fn nullability(&self) -> Option<Nullability>
Returns the nullability status of this data type
In Avro, nullability is represented through unions with null types. The returned value indicates how nulls are encoded in the Avro format:
Some(Nullability::NullFirst)
- Nulls are encoded as the first union variantSome(Nullability::NullSecond)
- Nulls are encoded as the second union variantNone
- The type is not nullable
Trait Implementations§
Source§impl Clone for AvroDataType
impl Clone for AvroDataType
Source§fn clone(&self) -> AvroDataType
fn clone(&self) -> AvroDataType
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 moreAuto Trait Implementations§
impl Freeze for AvroDataType
impl RefUnwindSafe for AvroDataType
impl Send for AvroDataType
impl Sync for AvroDataType
impl Unpin for AvroDataType
impl UnwindSafe for AvroDataType
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