Type Alias LargeBinaryArray

pub type LargeBinaryArray = BinaryArray<i64>;

Aliased Type§

struct LargeBinaryArray { /* private fields */ }

Implementations

§

impl<O> BinaryArray<O>
where O: Offset,

pub fn try_new( dtype: ArrowDataType, offsets: OffsetsBuffer<O>, values: Buffer<u8>, validity: Option<Bitmap>, ) -> Result<BinaryArray<O>, PolarsError>

Returns a [BinaryArray] created from its internal representation.

§Errors

This function returns an error iff:

  • The last offset is not equal to the values’ length.
  • the validity’s length is not equal to offsets.len().
  • The dtype’s [crate::datatypes::PhysicalType] is not equal to either Binary or LargeBinary.
§Implementation

This function is O(1)

pub unsafe fn new_unchecked( dtype: ArrowDataType, offsets: OffsetsBuffer<O>, values: Buffer<u8>, validity: Option<Bitmap>, ) -> BinaryArray<O>

Creates a new [BinaryArray] without checking invariants.

§Safety

The invariants must be valid (see try_new).

pub fn from_slice<T, P>(slice: P) -> BinaryArray<O>
where T: AsRef<[u8]>, P: AsRef<[T]>,

Creates a new [BinaryArray] from slices of &[u8].

pub fn from<T, P>(slice: P) -> BinaryArray<O>
where T: AsRef<[u8]>, P: AsRef<[Option<T>]>,

Creates a new [BinaryArray] from a slice of optional &[u8].

pub fn iter( &self, ) -> ZipValidity<&[u8], ArrayValuesIter<'_, BinaryArray<O>>, BitmapIter<'_>>

Returns an iterator of Option<&[u8]> over every element of this array.

pub fn values_iter(&self) -> ArrayValuesIter<'_, BinaryArray<O>>

Returns an iterator of &[u8] over every element of this array, ignoring the validity

pub fn non_null_values_iter(&self) -> NonNullValuesIter<'_, BinaryArray<O>>

Returns an iterator of the non-null values.

pub fn len(&self) -> usize

Returns the length of this array

pub fn value(&self, i: usize) -> &[u8]

Returns the element at index i

§Panics

iff i >= self.len()

pub unsafe fn value_unchecked(&self, i: usize) -> &[u8]

Returns the element at index i

§Safety

Assumes that the i < self.len.

pub fn get(&self, i: usize) -> Option<&[u8]>

Returns the element at index i or None if it is null

§Panics

iff i >= self.len()

pub fn dtype(&self) -> &ArrowDataType

Returns the ArrowDataType of this array.

pub fn values(&self) -> &Buffer<u8>

Returns the values of this [BinaryArray].

pub fn offsets(&self) -> &OffsetsBuffer<O>

Returns the offsets of this [BinaryArray].

pub fn validity(&self) -> Option<&Bitmap>

The optional validity.

pub fn slice(&mut self, offset: usize, length: usize)

Slices this [BinaryArray].

§Implementation

This function is O(1).

§Panics

iff offset + length > self.len().

pub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)

Slices this [BinaryArray].

§Implementation

This function is O(1).

§Safety

The caller must ensure that offset + length <= self.len().

pub fn sliced(self, offset: usize, length: usize) -> BinaryArray<O>

Returns this array sliced.

§Implementation

This function is O(1).

§Panics

iff offset + length > self.len().

pub unsafe fn sliced_unchecked( self, offset: usize, length: usize, ) -> BinaryArray<O>

Returns this array sliced.

§Implementation

This function is O(1).

§Safety

The caller must ensure that offset + length <= self.len().

pub fn with_validity(self, validity: Option<Bitmap>) -> BinaryArray<O>

Returns this array with a new validity.

§Panic

Panics iff validity.len() != self.len().

pub fn set_validity(&mut self, validity: Option<Bitmap>)

Sets the validity of this array.

§Panics

This function panics iff values.len() != self.len().

pub fn take_validity(&mut self) -> Option<Bitmap>

Takes the validity of this array, leaving it without a validity mask.

pub fn boxed(self) -> Box<dyn Array>

Boxes this array into a Box<dyn Array>.

pub fn arced(self) -> Arc<dyn Array>

Arcs this array into a std::sync::Arc<dyn Array>.

pub fn into_inner( self, ) -> (ArrowDataType, OffsetsBuffer<O>, Buffer<u8>, Option<Bitmap>)

Returns its internal representation

pub fn into_mut(self) -> Either<BinaryArray<O>, MutableBinaryArray<O>>

Try to convert this BinaryArray to a MutableBinaryArray

pub fn new_empty(dtype: ArrowDataType) -> BinaryArray<O>

Creates an empty [BinaryArray], i.e. whose .len is zero.

pub fn new_null(dtype: ArrowDataType, length: usize) -> BinaryArray<O>

Creates an null [BinaryArray], i.e. whose .null_count() == .len().

pub fn default_dtype() -> ArrowDataType

Returns the default ArrowDataType, DataType::Binary or DataType::LargeBinary

pub fn new( dtype: ArrowDataType, offsets: OffsetsBuffer<O>, values: Buffer<u8>, validity: Option<Bitmap>, ) -> BinaryArray<O>

Alias for unwrapping [Self::try_new]

pub fn from_trusted_len_values_iter<T, I>(iterator: I) -> BinaryArray<O>
where T: AsRef<[u8]>, I: TrustedLen<Item = T>,

Returns a [BinaryArray] from an iterator of trusted length.

The [BinaryArray] is guaranteed to not have a validity

pub fn from_iter_values<T, I>(iterator: I) -> BinaryArray<O>
where T: AsRef<[u8]>, I: Iterator<Item = T>,

Returns a new [BinaryArray] from a Iterator of &[u8].

The [BinaryArray] is guaranteed to not have a validity

pub unsafe fn from_trusted_len_iter_unchecked<I, P>( iterator: I, ) -> BinaryArray<O>
where P: AsRef<[u8]>, I: Iterator<Item = Option<P>>,

Creates a [BinaryArray] from an iterator of trusted length.

§Safety

The iterator must be TrustedLen. I.e. that size_hint().1 correctly reports its length.

pub fn from_trusted_len_iter<I, P>(iterator: I) -> BinaryArray<O>
where P: AsRef<[u8]>, I: TrustedLen<Item = Option<P>>,

Creates a [BinaryArray] from a [TrustedLen]

pub unsafe fn try_from_trusted_len_iter_unchecked<E, I, P>( iterator: I, ) -> Result<BinaryArray<O>, E>
where P: AsRef<[u8]>, I: IntoIterator<Item = Result<Option<P>, E>>,

Creates a [BinaryArray] from an falible iterator of trusted length.

§Safety

The iterator must be TrustedLen. I.e. that size_hint().1 correctly reports its length.

pub fn try_from_trusted_len_iter<E, I, P>(iter: I) -> Result<BinaryArray<O>, E>
where P: AsRef<[u8]>, I: TrustedLen<Item = Result<Option<P>, E>>,

Creates a [BinaryArray] from an fallible iterator of trusted length.

Trait Implementations

§

impl<O> Array for BinaryArray<O>
where O: Offset,

§

fn as_any(&self) -> &(dyn Any + 'static)

Converts itself to a reference of Any, which enables downcasting to concrete types.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts itself to a mutable reference of Any, which enables mutable downcasting to concrete types.
§

fn len(&self) -> usize

The length of the [Array]. Every array has a length corresponding to the number of elements (slots).
§

fn dtype(&self) -> &ArrowDataType

The ArrowDataType of the [Array]. In combination with [Array::as_any], this can be used to downcast trait objects (dyn Array) to concrete arrays.
§

fn split_at_boxed(&self, offset: usize) -> (Box<dyn Array>, Box<dyn Array>)

Split [Self] at offset into two boxed [Array]s where offset <= self.len().
§

unsafe fn split_at_boxed_unchecked( &self, offset: usize, ) -> (Box<dyn Array>, Box<dyn Array>)

Split [Self] at offset into two boxed [Array]s without checking offset <= self.len(). Read more
§

fn slice(&mut self, offset: usize, length: usize)

Slices this [Array]. Read more
§

unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)

Slices the [Array]. Read more
§

fn to_boxed(&self) -> Box<dyn Array>

Clone a &dyn Array to an owned Box<dyn Array>.
§

fn validity(&self) -> Option<&Bitmap>

The validity of the [Array]: every array has an optional [Bitmap] that, when available specifies whether the array slot is valid or not (null). When the validity is None, all slots are valid.
§

fn with_validity(&self, validity: Option<Bitmap>) -> Box<dyn Array>

Clones this [Array] with a new assigned bitmap. Read more
§

fn is_empty(&self) -> bool

whether the array is empty
§

fn null_count(&self) -> usize

The number of null slots on this [Array]. Read more
§

fn has_nulls(&self) -> bool

§

fn is_null(&self, i: usize) -> bool

Returns whether slot i is null. Read more
§

unsafe fn is_null_unchecked(&self, i: usize) -> bool

Returns whether slot i is null. Read more
§

fn is_valid(&self, i: usize) -> bool

Returns whether slot i is valid. Read more
§

fn sliced(&self, offset: usize, length: usize) -> Box<dyn Array>

Returns a slice of this [Array]. Read more
§

unsafe fn sliced_unchecked( &self, offset: usize, length: usize, ) -> Box<dyn Array>

Returns a slice of this [Array]. Read more
§

impl<'a, O> ArrayAccessor<'a> for BinaryArray<O>
where O: Offset,

§

type Item = &'a [u8]

§

unsafe fn value_unchecked( &'a self, index: usize, ) -> <BinaryArray<O> as ArrayAccessor<'a>>::Item

Safety Read more
§

fn len(&self) -> usize

§

impl<T> ArrayFromIter<Option<T>> for BinaryArray<i64>
where T: IntoBytes,

§

fn arr_from_iter<I>(iter: I) -> BinaryArray<i64>
where I: IntoIterator<Item = Option<T>>,

§

fn arr_from_iter_trusted<I>(iter: I) -> BinaryArray<i64>
where I: IntoIterator<Item = Option<T>>, <I as IntoIterator>::IntoIter: TrustedLen,

§

fn try_arr_from_iter<E, I>(iter: I) -> Result<BinaryArray<i64>, E>
where I: IntoIterator<Item = Result<Option<T>, E>>,

§

fn try_arr_from_iter_trusted<E, I>(iter: I) -> Result<BinaryArray<i64>, E>
where I: IntoIterator<Item = Result<Option<T>, E>>, <I as IntoIterator>::IntoIter: TrustedLen,

§

impl<T> ArrayFromIter<T> for BinaryArray<i64>
where T: IntoBytes,

§

fn arr_from_iter<I>(iter: I) -> BinaryArray<i64>
where I: IntoIterator<Item = T>,

§

fn arr_from_iter_trusted<I>(iter: I) -> BinaryArray<i64>
where I: IntoIterator<Item = T>, <I as IntoIterator>::IntoIter: TrustedLen,

§

fn try_arr_from_iter<E, I>(iter: I) -> Result<BinaryArray<i64>, E>
where I: IntoIterator<Item = Result<T, E>>,

§

fn try_arr_from_iter_trusted<E, I>(iter: I) -> Result<Self, E>
where I: IntoIterator<Item = Result<T, E>>, <I as IntoIterator>::IntoIter: TrustedLen,

§

impl BinaryFromIter for BinaryArray<i64>

§

fn from_values_iter<I, S>( iter: I, len: usize, value_cap: usize, ) -> BinaryArray<i64>
where S: AsRef<[u8]>, I: Iterator<Item = S>,

§

impl<O> Clone for BinaryArray<O>
where O: Clone + Offset,

§

fn clone(&self) -> BinaryArray<O>

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
§

impl<O> Debug for BinaryArray<O>
where O: Offset,

§

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

Formats the value using the given formatter. Read more
§

impl<O> From<MutableBinaryArray<O>> for BinaryArray<O>
where O: Offset,

§

fn from(other: MutableBinaryArray<O>) -> BinaryArray<O>

Converts to this type from the input type.
§

impl<O> From<MutableBinaryValuesArray<O>> for BinaryArray<O>
where O: Offset,

§

fn from(other: MutableBinaryValuesArray<O>) -> BinaryArray<O>

Converts to this type from the input type.
§

impl FromDataBinary for BinaryArray<i64>

§

unsafe fn from_data_unchecked_default( offsets: Buffer<i64>, values: Buffer<u8>, validity: Option<Bitmap>, ) -> BinaryArray<i64>

Safety Read more
§

impl<O, P> FromIterator<Option<P>> for BinaryArray<O>
where O: Offset, P: AsRef<[u8]>,

§

fn from_iter<I>(iter: I) -> BinaryArray<O>
where I: IntoIterator<Item = Option<P>>,

Creates a value from an iterator. Read more
§

impl<O> GenericBinaryArray<O> for BinaryArray<O>
where O: Offset,

§

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

The values of the array
§

fn offsets(&self) -> &[O]

The offsets of the array
§

impl<O> MinMaxKernel for BinaryArray<O>
where O: Offset,

§

type Scalar<'a> = &'a [u8]

§

fn min_ignore_nan_kernel( &self, ) -> Option<<BinaryArray<O> as MinMaxKernel>::Scalar<'_>>

§

fn max_ignore_nan_kernel( &self, ) -> Option<<BinaryArray<O> as MinMaxKernel>::Scalar<'_>>

§

fn min_propagate_nan_kernel( &self, ) -> Option<<BinaryArray<O> as MinMaxKernel>::Scalar<'_>>

§

fn max_propagate_nan_kernel( &self, ) -> Option<<BinaryArray<O> as MinMaxKernel>::Scalar<'_>>

§

fn min_max_ignore_nan_kernel( &self, ) -> Option<(Self::Scalar<'_>, Self::Scalar<'_>)>

§

fn min_max_propagate_nan_kernel( &self, ) -> Option<(Self::Scalar<'_>, Self::Scalar<'_>)>

§

impl ParameterFreeDtypeStaticArray for BinaryArray<i64>

§

impl<O> PartialEq<&(dyn Array + 'static)> for BinaryArray<O>
where O: Offset,

§

fn eq(&self, other: &&(dyn Array + 'static)) -> 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.
§

impl<O> PartialEq for BinaryArray<O>
where O: Offset,

§

fn eq(&self, other: &BinaryArray<O>) -> 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.
§

impl<O> Splitable for BinaryArray<O>
where O: Offset,

§

fn check_bound(&self, offset: usize) -> bool

§

unsafe fn _split_at_unchecked( &self, offset: usize, ) -> (BinaryArray<O>, BinaryArray<O>)

Internal implementation of split_at_unchecked. For any usage, prefer the using split_at or split_at_unchecked. Read more
§

fn split_at(&self, offset: usize) -> (Self, Self)

Split [Self] at offset where offset <= self.len().
§

unsafe fn split_at_unchecked(&self, offset: usize) -> (Self, Self)

Split [Self] at offset without checking offset <= self.len(). Read more
§

impl StaticArray for BinaryArray<i64>

§

type ValueT<'a> = &'a [u8]

§

type ZeroableValueT<'a> = Option<&'a [u8]>

§

type ValueIterT<'a> = ArrayValuesIter<'a, BinaryArray<i64>>

§

unsafe fn value_unchecked( &self, idx: usize, ) -> <BinaryArray<i64> as StaticArray>::ValueT<'_>

Safety Read more
§

fn values_iter(&self) -> <BinaryArray<i64> as StaticArray>::ValueIterT<'_>

§

fn iter( &self, ) -> ZipValidity<<BinaryArray<i64> as StaticArray>::ValueT<'_>, <BinaryArray<i64> as StaticArray>::ValueIterT<'_>, BitmapIter<'_>>

§

fn with_validity_typed(self, validity: Option<Bitmap>) -> BinaryArray<i64>

§

fn full_null(length: usize, dtype: ArrowDataType) -> BinaryArray<i64>

§

fn get(&self, idx: usize) -> Option<Self::ValueT<'_>>

§

unsafe fn get_unchecked(&self, idx: usize) -> Option<Self::ValueT<'_>>

Safety Read more
§

fn last(&self) -> Option<Self::ValueT<'_>>

§

fn value(&self, idx: usize) -> Self::ValueT<'_>

§

fn as_slice(&self) -> Option<&[Self::ValueT<'_>]>

§

fn from_vec(v: Vec<Self::ValueT<'_>>, dtype: ArrowDataType) -> Self

§

fn from_zeroable_vec( v: Vec<Self::ZeroableValueT<'_>>, dtype: ArrowDataType, ) -> Self

§

fn full(length: usize, value: Self::ValueT<'_>, dtype: ArrowDataType) -> Self

§

impl<O> TotalEqKernel for BinaryArray<O>
where O: Offset,

§

type Scalar = [u8]

§

fn tot_eq_kernel(&self, other: &BinaryArray<O>) -> Bitmap

§

fn tot_ne_kernel(&self, other: &BinaryArray<O>) -> Bitmap

§

fn tot_eq_kernel_broadcast( &self, other: &<BinaryArray<O> as TotalEqKernel>::Scalar, ) -> Bitmap

§

fn tot_ne_kernel_broadcast( &self, other: &<BinaryArray<O> as TotalEqKernel>::Scalar, ) -> Bitmap

§

fn tot_eq_missing_kernel(&self, other: &Self) -> Bitmap

§

fn tot_ne_missing_kernel(&self, other: &Self) -> Bitmap

§

fn tot_eq_missing_kernel_broadcast(&self, other: &Self::Scalar) -> Bitmap

§

fn tot_ne_missing_kernel_broadcast(&self, other: &Self::Scalar) -> Bitmap

§

impl<O> TotalOrdKernel for BinaryArray<O>
where O: Offset,

§

type Scalar = [u8]

§

fn tot_lt_kernel(&self, other: &BinaryArray<O>) -> Bitmap

§

fn tot_le_kernel(&self, other: &BinaryArray<O>) -> Bitmap

§

fn tot_lt_kernel_broadcast( &self, other: &<BinaryArray<O> as TotalOrdKernel>::Scalar, ) -> Bitmap

§

fn tot_le_kernel_broadcast( &self, other: &<BinaryArray<O> as TotalOrdKernel>::Scalar, ) -> Bitmap

§

fn tot_gt_kernel_broadcast( &self, other: &<BinaryArray<O> as TotalOrdKernel>::Scalar, ) -> Bitmap

§

fn tot_ge_kernel_broadcast( &self, other: &<BinaryArray<O> as TotalOrdKernel>::Scalar, ) -> Bitmap

§

fn tot_gt_kernel(&self, other: &Self) -> Bitmap

§

fn tot_ge_kernel(&self, other: &Self) -> Bitmap

§

impl<O> ValueSize for BinaryArray<O>
where O: Offset,

§

fn get_values_size(&self) -> usize

Get the values size that is still “visible” to the underlying array. E.g. take the offsets into account.
§

impl ArrowArray for BinaryArray<i64>