parquet::arrow::buffer::view_buffer

Struct ViewBuffer

Source
pub struct ViewBuffer {
    pub views: Vec<u128>,
    pub buffers: Vec<Buffer>,
}
Expand description

A buffer of view type byte arrays that can be converted into GenericByteViewArray

Note this does not reuse GenericByteViewBuilder due to the need to call pad_nulls and reuse the existing logic for Vec in the parquet crate

Fields§

§views: Vec<u128>§buffers: Vec<Buffer>

Implementations§

Source§

impl ViewBuffer

Source

pub fn is_empty(&self) -> bool

Source

pub fn append_block(&mut self, block: Buffer) -> u32

Source

pub unsafe fn append_view_unchecked( &mut self, block: u32, offset: u32, len: u32, )

§Safety

This method is only safe when:

  • block is a valid index, i.e., the return value of append_block
  • offset and offset + len are valid indices into the buffer
  • The (offset, offset + len) is valid value for the native type.
Source

pub unsafe fn append_raw_view_unchecked(&mut self, view: &u128)

Directly append a view to the view array. This is used when we create a StringViewArray from a dictionary whose values are StringViewArray.

§Safety

The view must be a valid view as per the ByteView spec.

Source

pub fn into_array( self, null_buffer: Option<Buffer>, data_type: &ArrowType, ) -> ArrayRef

Converts this into an [ArrayRef] with the provided data_type and null_buffer

Trait Implementations§

Source§

impl Debug for ViewBuffer

Source§

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

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

impl Default for ViewBuffer

Source§

fn default() -> ViewBuffer

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

impl ValuesBuffer for ViewBuffer

Source§

fn pad_nulls( &mut self, read_offset: usize, values_read: usize, levels_read: usize, valid_mask: &[u8], )

If a column contains nulls, more level data may be read than value data, as null values are not encoded. Therefore, first the levels data is read, the null count determined, and then the corresponding number of values read to a ValuesBuffer. 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> 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<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