parquet::data_type

Struct FixedLenByteArray

Source
#[repr(transparent)]
pub struct FixedLenByteArray(ByteArray);
Expand description

Wrapper type for performance reasons, this represents FIXED_LEN_BYTE_ARRAY but in all other considerations behaves the same as ByteArray

§Performance notes:

This type is a little unfortunate, without it the compiler generates code that takes quite a big hit on the CPU pipeline. Essentially the previous version stalls awaiting the result of T::get_physical_type() == Type::FIXED_LEN_BYTE_ARRAY.

Its debatable if this is wanted, it is out of spec for what parquet documents as its base types, although there are code paths in the Rust (and potentially the C++) versions that warrant this.

With this wrapper type the compiler generates more targeted code paths matching the higher level logical types, removing the data-hazard from all decoding and encoding paths.

Tuple Fields§

§0: ByteArray

Methods from Deref<Target = ByteArray>§

Source

pub fn len(&self) -> usize

Gets length of the underlying byte buffer.

Source

pub fn is_empty(&self) -> bool

Checks if the underlying buffer is empty.

Source

pub fn data(&self) -> &[u8]

Returns slice of data.

Source

pub fn set_data(&mut self, data: Bytes)

Set data from another byte buffer.

Source

pub fn slice(&self, start: usize, len: usize) -> Self

Returns ByteArray instance with slice of values for a data.

Source

pub fn as_utf8(&self) -> Result<&str>

Try to convert the byte array to a utf8 slice

Trait Implementations§

Source§

impl AsBytes for FixedLenByteArray

Source§

fn as_bytes(&self) -> &[u8]

Returns slice of bytes for this data type.
Source§

impl AsRef<[u8]> for FixedLenByteArray

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for FixedLenByteArray

Source§

fn clone(&self) -> FixedLenByteArray

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FixedLenByteArray

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FixedLenByteArray

Source§

fn default() -> FixedLenByteArray

Returns the “default value” for a type. Read more
Source§

impl Deref for FixedLenByteArray

Source§

type Target = ByteArray

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for FixedLenByteArray

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl Display for FixedLenByteArray

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<ByteArray> for FixedLenByteArray

Source§

fn from(other: ByteArray) -> Self

Converts to this type from the input type.
Source§

impl From<FixedLenByteArray> for ByteArray

Source§

fn from(other: FixedLenByteArray) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for FixedLenByteArray

Source§

fn from(buf: Vec<u8>) -> FixedLenByteArray

Converts to this type from the input type.
Source§

impl HeapSize for FixedLenByteArray

Source§

fn heap_size(&self) -> usize

Return the size of any bytes allocated on the heap by this object, including heap memory in those structures Read more
Source§

impl MakeStatistics for FixedLenByteArray

Source§

fn make_statistics(statistics: ValueStatistics<Self>) -> Statistics
where Self: Sized,

Source§

impl ParquetValueType for FixedLenByteArray

Source§

const PHYSICAL_TYPE: Type = Type::FIXED_LEN_BYTE_ARRAY

Source§

fn encode<W: Write>( values: &[Self], writer: &mut W, _: &mut BitWriter, ) -> Result<()>

Encode the value directly from a higher level encoder
Source§

fn set_data(decoder: &mut PlainDecoderDetails, data: Bytes, num_values: usize)

Establish the data that will be decoded in a buffer
Source§

fn decode( buffer: &mut [Self], decoder: &mut PlainDecoderDetails, ) -> Result<usize>

Decode the value from a given buffer for a higher level decoder
Source§

fn skip(decoder: &mut PlainDecoderDetails, num_values: usize) -> Result<usize>

Source§

fn dict_encoding_size(&self) -> (usize, usize)

Return the encoded size for a type
Source§

fn as_any(&self) -> &dyn Any

Return the value as an Any to allow for downcasts without transmutation
Source§

fn as_mut_any(&mut self) -> &mut dyn Any

Return the value as an mutable Any to allow for downcasts without transmutation
Source§

fn set_from_bytes(&mut self, data: Bytes)

Sets the value of this object from the provided [Bytes] Read more
Source§

fn variable_length_bytes(_: &[Self]) -> Option<i64>

Return the number of variable length bytes in a given slice of data Read more
Source§

fn as_i64(&self) -> Result<i64>

Return the value as i64 if possible Read more
Source§

fn as_u64(&self) -> Result<u64>

Return the value as u64 if possible Read more
Source§

impl PartialEq<ByteArray> for FixedLenByteArray

Source§

fn eq(&self, other: &ByteArray) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<FixedLenByteArray> for ByteArray

Source§

fn eq(&self, other: &FixedLenByteArray) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for FixedLenByteArray

Source§

fn eq(&self, other: &FixedLenByteArray) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd<ByteArray> for FixedLenByteArray

Source§

fn partial_cmp(&self, other: &ByteArray) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<FixedLenByteArray> for ByteArray

Source§

fn partial_cmp(&self, other: &FixedLenByteArray) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd for FixedLenByteArray

Source§

fn partial_cmp(&self, other: &FixedLenByteArray) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl SliceAsBytes for FixedLenByteArray

Source§

fn slice_as_bytes(_self: &[Self]) -> &[u8]

Returns slice of bytes for a slice of this data type.
Source§

unsafe fn slice_as_bytes_mut(_self: &mut [Self]) -> &mut [u8]

Return the internal representation as a mutable slice Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T