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

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

Array whose elements are of primitive types.

Implementations

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 len(&self) -> usize[src]

Returns the length of this array.

pub fn is_empty(&self) -> bool[src]

Returns whether this array is empty.

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

Returns a raw pointer to the values of this array.

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.

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 builder(capacity: usize) -> BooleanBuilder[src]

impl<'a, T: ArrowPrimitiveType> PrimitiveArray<T>[src]

pub fn iter(&'a self) -> PrimitiveIter<'a, T>

Notable traits for PrimitiveIter<'a, T>

impl<'a, T: ArrowPrimitiveType> Iterator for PrimitiveIter<'a, T> type Item = Option<T::Native>;
[src]

constructs a new iterator

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

pub fn from_vec(data: Vec<i64>, timezone: Option<Arc<String>>) -> Self[src]

Construct a timestamp array from a vec of i64 values and an optional timezone

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

pub fn from_opt_vec(
    data: Vec<Option<i64>>,
    timezone: Option<Arc<String>>
) -> Self
[src]

Construct a timestamp array from a vec of Option values and an optional timezone

Trait Implementations

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

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

Returns the total number of bytes of memory occupied by the buffers owned by this PrimitiveArray.

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

Returns the total number of bytes of memory occupied physically by this PrimitiveArray.

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

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

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]

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

Constructs a PrimitiveArray from an array data reference.

impl From<Vec<<Date32Type as ArrowPrimitiveType>::Native>> for PrimitiveArray<Date32Type>[src]

impl From<Vec<<Date64Type as ArrowPrimitiveType>::Native>> for PrimitiveArray<Date64Type>[src]

impl From<Vec<<DurationMicrosecondType as ArrowPrimitiveType>::Native>> for PrimitiveArray<DurationMicrosecondType>[src]

impl From<Vec<<DurationMillisecondType as ArrowPrimitiveType>::Native>> for PrimitiveArray<DurationMillisecondType>[src]

impl From<Vec<<DurationNanosecondType as ArrowPrimitiveType>::Native>> for PrimitiveArray<DurationNanosecondType>[src]

impl From<Vec<<DurationSecondType as ArrowPrimitiveType>::Native>> for PrimitiveArray<DurationSecondType>[src]

impl From<Vec<<Float32Type as ArrowPrimitiveType>::Native>> for PrimitiveArray<Float32Type>[src]

impl From<Vec<<Float64Type as ArrowPrimitiveType>::Native>> for PrimitiveArray<Float64Type>[src]

impl From<Vec<<Int16Type as ArrowPrimitiveType>::Native>> for PrimitiveArray<Int16Type>[src]

impl From<Vec<<Int32Type as ArrowPrimitiveType>::Native>> for PrimitiveArray<Int32Type>[src]

impl From<Vec<<Int64Type as ArrowPrimitiveType>::Native>> for PrimitiveArray<Int64Type>[src]

impl From<Vec<<Int8Type as ArrowPrimitiveType>::Native>> for PrimitiveArray<Int8Type>[src]

impl From<Vec<<IntervalDayTimeType as ArrowPrimitiveType>::Native>> for PrimitiveArray<IntervalDayTimeType>[src]

impl From<Vec<<IntervalYearMonthType as ArrowPrimitiveType>::Native>> for PrimitiveArray<IntervalYearMonthType>[src]

impl From<Vec<<Time32MillisecondType as ArrowPrimitiveType>::Native>> for PrimitiveArray<Time32MillisecondType>[src]

impl From<Vec<<Time32SecondType as ArrowPrimitiveType>::Native>> for PrimitiveArray<Time32SecondType>[src]

impl From<Vec<<Time64MicrosecondType as ArrowPrimitiveType>::Native>> for PrimitiveArray<Time64MicrosecondType>[src]

impl From<Vec<<Time64NanosecondType as ArrowPrimitiveType>::Native>> for PrimitiveArray<Time64NanosecondType>[src]

impl From<Vec<<TimestampMicrosecondType as ArrowPrimitiveType>::Native>> for PrimitiveArray<TimestampMicrosecondType>[src]

impl From<Vec<<TimestampMillisecondType as ArrowPrimitiveType>::Native>> for PrimitiveArray<TimestampMillisecondType>[src]

impl From<Vec<<UInt16Type as ArrowPrimitiveType>::Native>> for PrimitiveArray<UInt16Type>[src]

impl From<Vec<<UInt32Type as ArrowPrimitiveType>::Native>> for PrimitiveArray<UInt32Type>[src]

impl From<Vec<<UInt64Type as ArrowPrimitiveType>::Native>> for PrimitiveArray<UInt64Type>[src]

impl From<Vec<<UInt8Type as ArrowPrimitiveType>::Native>> for PrimitiveArray<UInt8Type>[src]

impl From<Vec<Option<<Date32Type as ArrowPrimitiveType>::Native>>> for PrimitiveArray<Date32Type>[src]

impl From<Vec<Option<<Date64Type as ArrowPrimitiveType>::Native>>> for PrimitiveArray<Date64Type>[src]

impl From<Vec<Option<<DurationMicrosecondType as ArrowPrimitiveType>::Native>>> for PrimitiveArray<DurationMicrosecondType>[src]

impl From<Vec<Option<<DurationMillisecondType as ArrowPrimitiveType>::Native>>> for PrimitiveArray<DurationMillisecondType>[src]

impl From<Vec<Option<<DurationNanosecondType as ArrowPrimitiveType>::Native>>> for PrimitiveArray<DurationNanosecondType>[src]

impl From<Vec<Option<<DurationSecondType as ArrowPrimitiveType>::Native>>> for PrimitiveArray<DurationSecondType>[src]

impl From<Vec<Option<<Float32Type as ArrowPrimitiveType>::Native>>> for PrimitiveArray<Float32Type>[src]

impl From<Vec<Option<<Float64Type as ArrowPrimitiveType>::Native>>> for PrimitiveArray<Float64Type>[src]

impl From<Vec<Option<<Int16Type as ArrowPrimitiveType>::Native>>> for PrimitiveArray<Int16Type>[src]

impl From<Vec<Option<<Int32Type as ArrowPrimitiveType>::Native>>> for PrimitiveArray<Int32Type>[src]

impl From<Vec<Option<<Int64Type as ArrowPrimitiveType>::Native>>> for PrimitiveArray<Int64Type>[src]

impl From<Vec<Option<<Int8Type as ArrowPrimitiveType>::Native>>> for PrimitiveArray<Int8Type>[src]

impl From<Vec<Option<<IntervalDayTimeType as ArrowPrimitiveType>::Native>>> for PrimitiveArray<IntervalDayTimeType>[src]

impl From<Vec<Option<<IntervalYearMonthType as ArrowPrimitiveType>::Native>>> for PrimitiveArray<IntervalYearMonthType>[src]

impl From<Vec<Option<<Time32MillisecondType as ArrowPrimitiveType>::Native>>> for PrimitiveArray<Time32MillisecondType>[src]

impl From<Vec<Option<<Time32SecondType as ArrowPrimitiveType>::Native>>> for PrimitiveArray<Time32SecondType>[src]

impl From<Vec<Option<<Time64MicrosecondType as ArrowPrimitiveType>::Native>>> for PrimitiveArray<Time64MicrosecondType>[src]

impl From<Vec<Option<<Time64NanosecondType as ArrowPrimitiveType>::Native>>> for PrimitiveArray<Time64NanosecondType>[src]

impl From<Vec<Option<<TimestampMicrosecondType as ArrowPrimitiveType>::Native>>> for PrimitiveArray<TimestampMicrosecondType>[src]

impl From<Vec<Option<<TimestampMillisecondType as ArrowPrimitiveType>::Native>>> for PrimitiveArray<TimestampMillisecondType>[src]

impl From<Vec<Option<<UInt16Type as ArrowPrimitiveType>::Native>>> for PrimitiveArray<UInt16Type>[src]

impl From<Vec<Option<<UInt32Type as ArrowPrimitiveType>::Native>>> for PrimitiveArray<UInt32Type>[src]

impl From<Vec<Option<<UInt64Type as ArrowPrimitiveType>::Native>>> for PrimitiveArray<UInt64Type>[src]

impl From<Vec<Option<<UInt8Type as ArrowPrimitiveType>::Native>>> for PrimitiveArray<UInt8Type>[src]

impl<T: ArrowPrimitiveType, Ptr: Borrow<Option<<T as ArrowPrimitiveType>::Native>>> FromIterator<Ptr> for PrimitiveArray<T>[src]

impl<'a, T: ArrowPrimitiveType> IntoIterator for &'a PrimitiveArray<T>[src]

type Item = Option<<T as ArrowPrimitiveType>::Native>

The type of the elements being iterated over.

type IntoIter = PrimitiveIter<'a, T>

Which kind of iterator are we turning this into?

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

Implement array equals for numeric type

impl<T: ArrowPrimitiveType> OrdArray for PrimitiveArray<T> where
    T::Native: Ord
[src]

impl PartialEq<PrimitiveArray<BooleanType>> for BooleanArray[src]

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

impl<T: ArrowPrimitiveType> PartialEq<PrimitiveArray<T>> for Value[src]

impl<T: ArrowPrimitiveType> PartialEq<Value> for PrimitiveArray<T>[src]

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

Auto Trait Implementations

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

impl<T> Send for PrimitiveArray<T>

impl<T> Sync for PrimitiveArray<T>

impl<T> Unpin for PrimitiveArray<T>

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

Blanket Implementations

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

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

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

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<V, T> VZip<V> for T where
    V: MultiLane<T>,