[][src]Struct arrow::array::PrimitiveArray

pub struct PrimitiveArray<T: ArrowPrimitiveType> { /* fields omitted */ }

Array whose elements are of primitive types.

Methods

impl<T: ArrowNumericType> PrimitiveArray<T>[src]

Implementation for primitive arrays with numeric types. Boolean arrays are bit-packed and so implemented separately.

pub fn new(
    length: usize,
    values: Buffer,
    null_count: usize,
    offset: usize
) -> Self
[src]

pub fn values(&self) -> Buffer[src]

Returns a Buffer holds all the values of this array.

Note this doesn't take account into the offset of this array.

pub fn len(&self) -> usize[src]

Returns the length of this array

pub fn raw_values(&self) -> *const T::Native[src]

Returns a raw pointer to the values of this array.

pub fn value(&self, i: usize) -> T::Native[src]

Returns the primitive value at index i.

Note this doesn't do any bound checking, for performance reason.

pub fn value_slice(&self, offset: usize, len: usize) -> &[T::Native][src]

Returns a slice for the given offset and length

Note this doesn't do any bound checking, for performance reason.

pub fn builder(capacity: usize) -> PrimitiveBuilder<T>[src]

impl<T: ArrowTemporalType + ArrowNumericType> PrimitiveArray<T> where
    i64: From<T::Native>, 
[src]

pub fn value_as_datetime(&self, i: usize) -> Option<NaiveDateTime>[src]

Returns value as a chrono NaiveDateTime, handling time resolution

If a data type cannot be converted to NaiveDateTime, a None is returned. A valid value is expected, thus the user should first check for validity. TODO: extract constants into static variables

pub fn value_as_date(&self, i: usize) -> Option<NaiveDate>[src]

Returns value as a chrono NaiveDate by using Self::datetime()

If a data type cannot be converted to NaiveDate, a None is returned

pub fn value_as_time(&self, i: usize) -> Option<NaiveTime>[src]

Returns a value as a chrono NaiveTime

Date32 and Date64 return UTC midnight as they do not have time resolution

impl PrimitiveArray<BooleanType>[src]

Specific implementation for Boolean arrays due to bit-packing

pub fn new(
    length: usize,
    values: Buffer,
    null_count: usize,
    offset: usize
) -> Self
[src]

pub fn values(&self) -> Buffer[src]

Returns a Buffer holds all the values of this array.

Note this doesn't take account into the offset of this array.

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

Returns the boolean value at index i.

pub fn builder(capacity: usize) -> BooleanBuilder[src]

Trait Implementations

impl<T: ArrowPrimitiveType> Array for PrimitiveArray<T>[src]

fn data_type(&self) -> &DataType[src]

Returns a reference to the data type of this array

fn slice(&self, offset: usize, length: usize) -> ArrayRef[src]

Returns a zero-copy slice of this array with the indicated offset and length.

fn len(&self) -> usize[src]

Returns the length (i.e., number of elements) of this array

fn offset(&self) -> usize[src]

Returns the offset of this array

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

Returns whether the element at index i is null

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

Returns whether the element at index i is not null

fn null_count(&self) -> usize[src]

Returns the total number of nulls in this array

impl From<Vec<i8>> for PrimitiveArray<Int8Type>[src]

impl From<Vec<Option<i8>>> for PrimitiveArray<Int8Type>[src]

impl From<Vec<i16>> for PrimitiveArray<Int16Type>[src]

impl From<Vec<Option<i16>>> for PrimitiveArray<Int16Type>[src]

impl From<Vec<i32>> for PrimitiveArray<Int32Type>[src]

impl From<Vec<Option<i32>>> for PrimitiveArray<Int32Type>[src]

impl From<Vec<i64>> for PrimitiveArray<Int64Type>[src]

impl From<Vec<Option<i64>>> for PrimitiveArray<Int64Type>[src]

impl From<Vec<u8>> for PrimitiveArray<UInt8Type>[src]

impl From<Vec<Option<u8>>> for PrimitiveArray<UInt8Type>[src]

impl From<Vec<u16>> for PrimitiveArray<UInt16Type>[src]

impl From<Vec<Option<u16>>> for PrimitiveArray<UInt16Type>[src]

impl From<Vec<u32>> for PrimitiveArray<UInt32Type>[src]

impl From<Vec<Option<u32>>> for PrimitiveArray<UInt32Type>[src]

impl From<Vec<u64>> for PrimitiveArray<UInt64Type>[src]

impl From<Vec<Option<u64>>> for PrimitiveArray<UInt64Type>[src]

impl From<Vec<f32>> for PrimitiveArray<Float32Type>[src]

impl From<Vec<Option<f32>>> for PrimitiveArray<Float32Type>[src]

impl From<Vec<f64>> for PrimitiveArray<Float64Type>[src]

impl From<Vec<Option<f64>>> for PrimitiveArray<Float64Type>[src]

impl From<Vec<i64>> for PrimitiveArray<TimestampSecondType>[src]

impl From<Vec<Option<i64>>> for PrimitiveArray<TimestampSecondType>[src]

impl From<Vec<i64>> for PrimitiveArray<TimestampMillisecondType>[src]

impl From<Vec<Option<i64>>> for PrimitiveArray<TimestampMillisecondType>[src]

impl From<Vec<i64>> for PrimitiveArray<TimestampMicrosecondType>[src]

impl From<Vec<Option<i64>>> for PrimitiveArray<TimestampMicrosecondType>[src]

impl From<Vec<i64>> for PrimitiveArray<TimestampNanosecondType>[src]

impl From<Vec<Option<i64>>> for PrimitiveArray<TimestampNanosecondType>[src]

impl From<Vec<i32>> for PrimitiveArray<Date32Type>[src]

impl From<Vec<Option<i32>>> for PrimitiveArray<Date32Type>[src]

impl From<Vec<i64>> for PrimitiveArray<Date64Type>[src]

impl From<Vec<Option<i64>>> for PrimitiveArray<Date64Type>[src]

impl From<Vec<i32>> for PrimitiveArray<Time32SecondType>[src]

impl From<Vec<Option<i32>>> for PrimitiveArray<Time32SecondType>[src]

impl From<Vec<i32>> for PrimitiveArray<Time32MillisecondType>[src]

impl From<Vec<Option<i32>>> for PrimitiveArray<Time32MillisecondType>[src]

impl From<Vec<i64>> for PrimitiveArray<Time64MicrosecondType>[src]

impl From<Vec<Option<i64>>> for PrimitiveArray<Time64MicrosecondType>[src]

impl From<Vec<i64>> for PrimitiveArray<Time64NanosecondType>[src]

impl From<Vec<Option<i64>>> for PrimitiveArray<Time64NanosecondType>[src]

impl<T: ArrowPrimitiveType> From<Arc<ArrayData>> for PrimitiveArray<T>[src]

Constructs a PrimitiveArray from an array data reference.

impl<T: ArrowNumericType> Debug for PrimitiveArray<T>[src]

impl<T: ArrowNumericType + ArrowTemporalType> Debug for PrimitiveArray<T> where
    i64: From<T::Native>, 
[src]

impl Debug for PrimitiveArray<BooleanType>[src]

Auto Trait Implementations

impl<T> Unpin for PrimitiveArray<T> where
    <T as ArrowPrimitiveType>::Native: Unpin

impl<T> Sync for PrimitiveArray<T>

impl<T> Send for PrimitiveArray<T>

impl<T> RefUnwindSafe for PrimitiveArray<T> where
    <T as ArrowPrimitiveType>::Native: RefUnwindSafe

impl<T> UnwindSafe for PrimitiveArray<T> where
    <T as ArrowPrimitiveType>::Native: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> FromCast<T> for T[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 
[src]