Struct arrow::array::PrimitiveArray [−][src]
pub struct PrimitiveArray<T: ArrowPrimitiveType> { /* fields omitted */ }
Expand description
Array whose elements are of primitive types.
Example: From an iterator of values
use arrow::array::{Array, PrimitiveArray};
use arrow::datatypes::Int32Type;
let arr: PrimitiveArray<Int32Type> = PrimitiveArray::from_iter_values((0..10).map(|x| x + 1));
assert_eq!(10, arr.len());
assert_eq!(0, arr.null_count());
for i in 0..10i32 {
assert_eq!(i + 1, arr.value(i as usize));
}
Implementations
Returns the primitive value at index i
.
Safety
caller must ensure that the passed in offset is less than the array len()
Returns the primitive value at index i
.
Panics of offset i
is out of bounds
Creates a PrimitiveArray based on an iterator of values without nulls
Creates a PrimitiveArray based on a constant value with count
elements
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.
Returns value as a chrono NaiveDateTime
, handling time resolution with the provided tz
functionally it is same as value_as_datetime
, however it adds
the passed tz to the to-be-returned NaiveDateTime
Returns value as a chrono NaiveDate
by using Self::datetime()
If a data type cannot be converted to NaiveDate
, a None
is returned
Returns a value as a chrono NaiveTime
Date32
and Date64
return UTC midnight as they do not have time resolution
Returns a value as a chrono Duration
If a data type cannot be converted to Duration
, a None
is returned
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>;
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>;
impl<'a, T: ArrowPrimitiveType> Iterator for PrimitiveIter<'a, T> type Item = Option<T::Native>;
constructs a new iterator
pub unsafe fn from_trusted_len_iter<I, P>(iter: I) -> Self where
P: Borrow<Option<<T as ArrowPrimitiveType>::Native>>,
I: IntoIterator<Item = P>,
pub unsafe fn from_trusted_len_iter<I, P>(iter: I) -> Self where
P: Borrow<Option<<T as ArrowPrimitiveType>::Native>>,
I: IntoIterator<Item = P>,
Creates a PrimitiveArray
from an iterator of trusted length.
Safety
The iterator must be TrustedLen
.
I.e. that size_hint().1
correctly reports its length.
Trait Implementations
Returns a reference-counted pointer to the underlying data of this array.
Returns a zero-copy slice of this array with the indicated offset and length. Read more
Returns the offset into the underlying data used by this array(-slice).
Note that the underlying data can be shared by many arrays.
This defaults to 0
. Read more
Returns whether the element at index
is null.
When using this function on a slice, the index is relative to the slice. Read more
Returns whether the element at index
is not null.
When using this function on a slice, the index is relative to the slice. Read more
Returns the total number of null values in this array. Read more
Returns the total number of bytes of memory pointed to by this array. The buffers store bytes in the Arrow memory format, and include the data as well as the validity map. Read more
Returns the total number of bytes of memory occupied physically by this array.
This value will always be greater than returned by get_buffer_memory_size()
and
includes the overhead of the data structures that contain the pointers to the various buffers. Read more
returns two pointers that represent this array in the C Data Interface (FFI)
Constructs a PrimitiveArray
from an array data reference.
impl From<Vec<<Date32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Date32Type>
impl From<Vec<<Date32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Date32Type>
Performs the conversion.
impl From<Vec<<Date64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Date64Type>
impl From<Vec<<Date64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Date64Type>
Performs the conversion.
impl From<Vec<<DurationMicrosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationMicrosecondType>
impl From<Vec<<DurationMicrosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationMicrosecondType>
Performs the conversion.
impl From<Vec<<DurationMillisecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationMillisecondType>
impl From<Vec<<DurationMillisecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationMillisecondType>
Performs the conversion.
impl From<Vec<<DurationNanosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationNanosecondType>
impl From<Vec<<DurationNanosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationNanosecondType>
Performs the conversion.
impl From<Vec<<DurationSecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationSecondType>
impl From<Vec<<DurationSecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationSecondType>
Performs the conversion.
impl From<Vec<<Float32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Float32Type>
impl From<Vec<<Float32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Float32Type>
Performs the conversion.
impl From<Vec<<Float64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Float64Type>
impl From<Vec<<Float64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Float64Type>
Performs the conversion.
impl From<Vec<<Int16Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int16Type>
impl From<Vec<<Int16Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int16Type>
impl From<Vec<<Int32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int32Type>
impl From<Vec<<Int32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int32Type>
impl From<Vec<<Int64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int64Type>
impl From<Vec<<Int64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int64Type>
impl From<Vec<<IntervalDayTimeType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<IntervalDayTimeType>
impl From<Vec<<IntervalDayTimeType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<IntervalDayTimeType>
Performs the conversion.
impl From<Vec<<IntervalYearMonthType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<IntervalYearMonthType>
impl From<Vec<<IntervalYearMonthType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<IntervalYearMonthType>
Performs the conversion.
impl From<Vec<<Time32MillisecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time32MillisecondType>
impl From<Vec<<Time32MillisecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time32MillisecondType>
Performs the conversion.
impl From<Vec<<Time32SecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time32SecondType>
impl From<Vec<<Time32SecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time32SecondType>
Performs the conversion.
impl From<Vec<<Time64MicrosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time64MicrosecondType>
impl From<Vec<<Time64MicrosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time64MicrosecondType>
Performs the conversion.
impl From<Vec<<Time64NanosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time64NanosecondType>
impl From<Vec<<Time64NanosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time64NanosecondType>
Performs the conversion.
impl From<Vec<<TimestampMicrosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampMicrosecondType>
impl From<Vec<<TimestampMicrosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampMicrosecondType>
Performs the conversion.
impl From<Vec<<TimestampMillisecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampMillisecondType>
impl From<Vec<<TimestampMillisecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampMillisecondType>
Performs the conversion.
impl From<Vec<<TimestampNanosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampNanosecondType>
impl From<Vec<<TimestampNanosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampNanosecondType>
Performs the conversion.
impl From<Vec<<TimestampSecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampSecondType>
impl From<Vec<<TimestampSecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampSecondType>
Performs the conversion.
impl From<Vec<<UInt16Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt16Type>
impl From<Vec<<UInt16Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt16Type>
Performs the conversion.
impl From<Vec<<UInt32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt32Type>
impl From<Vec<<UInt32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt32Type>
Performs the conversion.
impl From<Vec<<UInt64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt64Type>
impl From<Vec<<UInt64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt64Type>
Performs the conversion.
impl From<Vec<<UInt8Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt8Type>
impl From<Vec<<UInt8Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt8Type>
impl From<Vec<Option<<Date32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Date32Type>
impl From<Vec<Option<<Date32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Date32Type>
Performs the conversion.
impl From<Vec<Option<<Date64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Date64Type>
impl From<Vec<Option<<Date64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Date64Type>
Performs the conversion.
impl From<Vec<Option<<DurationMicrosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationMicrosecondType>
impl From<Vec<Option<<DurationMicrosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationMicrosecondType>
Performs the conversion.
impl From<Vec<Option<<DurationMillisecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationMillisecondType>
impl From<Vec<Option<<DurationMillisecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationMillisecondType>
Performs the conversion.
impl From<Vec<Option<<DurationNanosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationNanosecondType>
impl From<Vec<Option<<DurationNanosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationNanosecondType>
Performs the conversion.
impl From<Vec<Option<<DurationSecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationSecondType>
impl From<Vec<Option<<DurationSecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationSecondType>
Performs the conversion.
impl From<Vec<Option<<Float32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Float32Type>
impl From<Vec<Option<<Float32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Float32Type>
Performs the conversion.
impl From<Vec<Option<<Float64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Float64Type>
impl From<Vec<Option<<Float64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Float64Type>
Performs the conversion.
impl From<Vec<Option<<Int16Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int16Type>
impl From<Vec<Option<<Int16Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int16Type>
impl From<Vec<Option<<Int32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int32Type>
impl From<Vec<Option<<Int32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int32Type>
impl From<Vec<Option<<Int64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int64Type>
impl From<Vec<Option<<Int64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int64Type>
impl From<Vec<Option<<Int8Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int8Type>
impl From<Vec<Option<<Int8Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int8Type>
impl From<Vec<Option<<IntervalDayTimeType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<IntervalDayTimeType>
impl From<Vec<Option<<IntervalDayTimeType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<IntervalDayTimeType>
Performs the conversion.
impl From<Vec<Option<<IntervalYearMonthType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<IntervalYearMonthType>
impl From<Vec<Option<<IntervalYearMonthType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<IntervalYearMonthType>
Performs the conversion.
impl From<Vec<Option<<Time32MillisecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time32MillisecondType>
impl From<Vec<Option<<Time32MillisecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time32MillisecondType>
Performs the conversion.
impl From<Vec<Option<<Time32SecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time32SecondType>
impl From<Vec<Option<<Time32SecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time32SecondType>
Performs the conversion.
impl From<Vec<Option<<Time64MicrosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time64MicrosecondType>
impl From<Vec<Option<<Time64MicrosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time64MicrosecondType>
Performs the conversion.
impl From<Vec<Option<<Time64NanosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time64NanosecondType>
impl From<Vec<Option<<Time64NanosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time64NanosecondType>
Performs the conversion.
impl From<Vec<Option<<TimestampMicrosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampMicrosecondType>
impl From<Vec<Option<<TimestampMicrosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampMicrosecondType>
Performs the conversion.
impl From<Vec<Option<<TimestampMillisecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampMillisecondType>
impl From<Vec<Option<<TimestampMillisecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampMillisecondType>
Performs the conversion.
impl From<Vec<Option<<TimestampNanosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampNanosecondType>
impl From<Vec<Option<<TimestampNanosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampNanosecondType>
Performs the conversion.
impl From<Vec<Option<<TimestampSecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampSecondType>
impl From<Vec<Option<<TimestampSecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampSecondType>
Performs the conversion.
impl From<Vec<Option<<UInt16Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt16Type>
impl From<Vec<Option<<UInt16Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt16Type>
Performs the conversion.
impl From<Vec<Option<<UInt32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt32Type>
impl From<Vec<Option<<UInt32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt32Type>
Performs the conversion.
impl From<Vec<Option<<UInt64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt64Type>
impl From<Vec<Option<<UInt64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt64Type>
Performs the conversion.
impl From<Vec<Option<<UInt8Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt8Type>
impl From<Vec<Option<<UInt8Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt8Type>
impl<T: ArrowPrimitiveType, Ptr: Borrow<Option<<T as ArrowPrimitiveType>::Native>>> FromIterator<Ptr> for PrimitiveArray<T>
impl<T: ArrowPrimitiveType, Ptr: Borrow<Option<<T as ArrowPrimitiveType>::Native>>> FromIterator<Ptr> for PrimitiveArray<T>
Creates a value from an iterator. Read more
type Item = Option<<T as ArrowPrimitiveType>::Native>
type Item = Option<<T as ArrowPrimitiveType>::Native>
The type of the elements being iterated over.
type IntoIter = PrimitiveIter<'a, T>
type IntoIter = PrimitiveIter<'a, T>
Which kind of iterator are we turning this into?
Implement array equals for numeric type