[−][src]Struct arrow::array::PrimitiveArray
Array whose elements are of primitive types.
Implementations
impl<T: ArrowPrimitiveType> PrimitiveArray<T>
[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 values(&self) -> &[T::Native]ⓘ
[src]
Returns a slice of the values of this array
pub fn builder(capacity: usize) -> PrimitiveBuilder<T>
[src]
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.
Safety
caller must ensure that the passed in offset is less than the array len()
impl<T: ArrowTemporalType + ArrowNumericType> PrimitiveArray<T> where
i64: From<T::Native>,
[src]
i64: From<T::Native>,
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<'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]
Notable traits for PrimitiveIter<'a, T>
impl<'a, T: ArrowPrimitiveType> Iterator for PrimitiveIter<'a, T> type Item = Option<T::Native>;
constructs a new iterator
impl<T: ArrowTimestampType> PrimitiveArray<T>
[src]
pub fn from_vec(data: Vec<i64>, timezone: Option<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<String>) -> Self
[src]
Construct a timestamp array from a vec of Option
Trait Implementations
impl<T: ArrowPrimitiveType> Array for PrimitiveArray<T>
[src]
fn as_any(&self) -> &dyn Any
[src]
fn data(&self) -> ArrayDataRef
[src]
fn data_ref(&self) -> &ArrayDataRef
[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.
fn data_type(&self) -> &DataType
[src]
fn slice(&self, offset: usize, length: usize) -> ArrayRef
[src]
fn len(&self) -> usize
[src]
fn is_empty(&self) -> bool
[src]
fn offset(&self) -> usize
[src]
fn is_null(&self, index: usize) -> bool
[src]
fn is_valid(&self, index: usize) -> bool
[src]
fn null_count(&self) -> usize
[src]
fn to_raw(&self) -> Result<(*const FFI_ArrowArray, *const FFI_ArrowSchema)>
[src]
impl<T: ArrowPrimitiveType> Debug for PrimitiveArray<T>
[src]
impl<T: ArrowPrimitiveType> From<Arc<ArrayData>> for PrimitiveArray<T>
[src]
Constructs a PrimitiveArray
from an array data reference.
fn from(data: ArrayDataRef) -> Self
[src]
impl From<Vec<<Date32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Date32Type>
[src]
fn from(data: Vec<<Date32Type as ArrowPrimitiveType>::Native>) -> Self
[src]
impl From<Vec<<Date64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Date64Type>
[src]
fn from(data: Vec<<Date64Type as ArrowPrimitiveType>::Native>) -> Self
[src]
impl From<Vec<<DurationMicrosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationMicrosecondType>
[src]
fn from(
data: Vec<<DurationMicrosecondType as ArrowPrimitiveType>::Native>
) -> Self
[src]
data: Vec<<DurationMicrosecondType as ArrowPrimitiveType>::Native>
) -> Self
impl From<Vec<<DurationMillisecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationMillisecondType>
[src]
fn from(
data: Vec<<DurationMillisecondType as ArrowPrimitiveType>::Native>
) -> Self
[src]
data: Vec<<DurationMillisecondType as ArrowPrimitiveType>::Native>
) -> Self
impl From<Vec<<DurationNanosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationNanosecondType>
[src]
fn from(
data: Vec<<DurationNanosecondType as ArrowPrimitiveType>::Native>
) -> Self
[src]
data: Vec<<DurationNanosecondType as ArrowPrimitiveType>::Native>
) -> Self
impl From<Vec<<DurationSecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<DurationSecondType>
[src]
fn from(data: Vec<<DurationSecondType as ArrowPrimitiveType>::Native>) -> Self
[src]
impl From<Vec<<Float32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Float32Type>
[src]
fn from(data: Vec<<Float32Type as ArrowPrimitiveType>::Native>) -> Self
[src]
impl From<Vec<<Float64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Float64Type>
[src]
fn from(data: Vec<<Float64Type as ArrowPrimitiveType>::Native>) -> Self
[src]
impl From<Vec<<Int16Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int16Type>
[src]
impl From<Vec<<Int32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int32Type>
[src]
impl From<Vec<<Int64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int64Type>
[src]
impl From<Vec<<Int8Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Int8Type>
[src]
impl From<Vec<<IntervalDayTimeType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<IntervalDayTimeType>
[src]
fn from(data: Vec<<IntervalDayTimeType as ArrowPrimitiveType>::Native>) -> Self
[src]
impl From<Vec<<IntervalYearMonthType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<IntervalYearMonthType>
[src]
fn from(
data: Vec<<IntervalYearMonthType as ArrowPrimitiveType>::Native>
) -> Self
[src]
data: Vec<<IntervalYearMonthType as ArrowPrimitiveType>::Native>
) -> Self
impl From<Vec<<Time32MillisecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time32MillisecondType>
[src]
fn from(
data: Vec<<Time32MillisecondType as ArrowPrimitiveType>::Native>
) -> Self
[src]
data: Vec<<Time32MillisecondType as ArrowPrimitiveType>::Native>
) -> Self
impl From<Vec<<Time32SecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time32SecondType>
[src]
fn from(data: Vec<<Time32SecondType as ArrowPrimitiveType>::Native>) -> Self
[src]
impl From<Vec<<Time64MicrosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time64MicrosecondType>
[src]
fn from(
data: Vec<<Time64MicrosecondType as ArrowPrimitiveType>::Native>
) -> Self
[src]
data: Vec<<Time64MicrosecondType as ArrowPrimitiveType>::Native>
) -> Self
impl From<Vec<<Time64NanosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<Time64NanosecondType>
[src]
fn from(data: Vec<<Time64NanosecondType as ArrowPrimitiveType>::Native>) -> Self
[src]
impl From<Vec<<TimestampMicrosecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampMicrosecondType>
[src]
fn from(
data: Vec<<TimestampMicrosecondType as ArrowPrimitiveType>::Native>
) -> Self
[src]
data: Vec<<TimestampMicrosecondType as ArrowPrimitiveType>::Native>
) -> Self
impl From<Vec<<TimestampMillisecondType as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<TimestampMillisecondType>
[src]
fn from(
data: Vec<<TimestampMillisecondType as ArrowPrimitiveType>::Native>
) -> Self
[src]
data: Vec<<TimestampMillisecondType as ArrowPrimitiveType>::Native>
) -> Self
impl From<Vec<<UInt16Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt16Type>
[src]
fn from(data: Vec<<UInt16Type as ArrowPrimitiveType>::Native>) -> Self
[src]
impl From<Vec<<UInt32Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt32Type>
[src]
fn from(data: Vec<<UInt32Type as ArrowPrimitiveType>::Native>) -> Self
[src]
impl From<Vec<<UInt64Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt64Type>
[src]
fn from(data: Vec<<UInt64Type as ArrowPrimitiveType>::Native>) -> Self
[src]
impl From<Vec<<UInt8Type as ArrowPrimitiveType>::Native, Global>> for PrimitiveArray<UInt8Type>
[src]
impl From<Vec<Option<<Date32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Date32Type>
[src]
fn from(data: Vec<Option<<Date32Type as ArrowPrimitiveType>::Native>>) -> Self
[src]
impl From<Vec<Option<<Date64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Date64Type>
[src]
fn from(data: Vec<Option<<Date64Type as ArrowPrimitiveType>::Native>>) -> Self
[src]
impl From<Vec<Option<<DurationMicrosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationMicrosecondType>
[src]
fn from(
data: Vec<Option<<DurationMicrosecondType as ArrowPrimitiveType>::Native>>
) -> Self
[src]
data: Vec<Option<<DurationMicrosecondType as ArrowPrimitiveType>::Native>>
) -> Self
impl From<Vec<Option<<DurationMillisecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationMillisecondType>
[src]
fn from(
data: Vec<Option<<DurationMillisecondType as ArrowPrimitiveType>::Native>>
) -> Self
[src]
data: Vec<Option<<DurationMillisecondType as ArrowPrimitiveType>::Native>>
) -> Self
impl From<Vec<Option<<DurationNanosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationNanosecondType>
[src]
fn from(
data: Vec<Option<<DurationNanosecondType as ArrowPrimitiveType>::Native>>
) -> Self
[src]
data: Vec<Option<<DurationNanosecondType as ArrowPrimitiveType>::Native>>
) -> Self
impl From<Vec<Option<<DurationSecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<DurationSecondType>
[src]
fn from(
data: Vec<Option<<DurationSecondType as ArrowPrimitiveType>::Native>>
) -> Self
[src]
data: Vec<Option<<DurationSecondType as ArrowPrimitiveType>::Native>>
) -> Self
impl From<Vec<Option<<Float32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Float32Type>
[src]
fn from(data: Vec<Option<<Float32Type as ArrowPrimitiveType>::Native>>) -> Self
[src]
impl From<Vec<Option<<Float64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Float64Type>
[src]
fn from(data: Vec<Option<<Float64Type as ArrowPrimitiveType>::Native>>) -> Self
[src]
impl From<Vec<Option<<Int16Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int16Type>
[src]
impl From<Vec<Option<<Int32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int32Type>
[src]
impl From<Vec<Option<<Int64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int64Type>
[src]
impl From<Vec<Option<<Int8Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Int8Type>
[src]
impl From<Vec<Option<<IntervalDayTimeType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<IntervalDayTimeType>
[src]
fn from(
data: Vec<Option<<IntervalDayTimeType as ArrowPrimitiveType>::Native>>
) -> Self
[src]
data: Vec<Option<<IntervalDayTimeType as ArrowPrimitiveType>::Native>>
) -> Self
impl From<Vec<Option<<IntervalYearMonthType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<IntervalYearMonthType>
[src]
fn from(
data: Vec<Option<<IntervalYearMonthType as ArrowPrimitiveType>::Native>>
) -> Self
[src]
data: Vec<Option<<IntervalYearMonthType as ArrowPrimitiveType>::Native>>
) -> Self
impl From<Vec<Option<<Time32MillisecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time32MillisecondType>
[src]
fn from(
data: Vec<Option<<Time32MillisecondType as ArrowPrimitiveType>::Native>>
) -> Self
[src]
data: Vec<Option<<Time32MillisecondType as ArrowPrimitiveType>::Native>>
) -> Self
impl From<Vec<Option<<Time32SecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time32SecondType>
[src]
fn from(
data: Vec<Option<<Time32SecondType as ArrowPrimitiveType>::Native>>
) -> Self
[src]
data: Vec<Option<<Time32SecondType as ArrowPrimitiveType>::Native>>
) -> Self
impl From<Vec<Option<<Time64MicrosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time64MicrosecondType>
[src]
fn from(
data: Vec<Option<<Time64MicrosecondType as ArrowPrimitiveType>::Native>>
) -> Self
[src]
data: Vec<Option<<Time64MicrosecondType as ArrowPrimitiveType>::Native>>
) -> Self
impl From<Vec<Option<<Time64NanosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<Time64NanosecondType>
[src]
fn from(
data: Vec<Option<<Time64NanosecondType as ArrowPrimitiveType>::Native>>
) -> Self
[src]
data: Vec<Option<<Time64NanosecondType as ArrowPrimitiveType>::Native>>
) -> Self
impl From<Vec<Option<<TimestampMicrosecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampMicrosecondType>
[src]
fn from(
data: Vec<Option<<TimestampMicrosecondType as ArrowPrimitiveType>::Native>>
) -> Self
[src]
data: Vec<Option<<TimestampMicrosecondType as ArrowPrimitiveType>::Native>>
) -> Self
impl From<Vec<Option<<TimestampMillisecondType as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<TimestampMillisecondType>
[src]
fn from(
data: Vec<Option<<TimestampMillisecondType as ArrowPrimitiveType>::Native>>
) -> Self
[src]
data: Vec<Option<<TimestampMillisecondType as ArrowPrimitiveType>::Native>>
) -> Self
impl From<Vec<Option<<UInt16Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt16Type>
[src]
fn from(data: Vec<Option<<UInt16Type as ArrowPrimitiveType>::Native>>) -> Self
[src]
impl From<Vec<Option<<UInt32Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt32Type>
[src]
fn from(data: Vec<Option<<UInt32Type as ArrowPrimitiveType>::Native>>) -> Self
[src]
impl From<Vec<Option<<UInt64Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt64Type>
[src]
fn from(data: Vec<Option<<UInt64Type as ArrowPrimitiveType>::Native>>) -> Self
[src]
impl From<Vec<Option<<UInt8Type as ArrowPrimitiveType>::Native>, Global>> for PrimitiveArray<UInt8Type>
[src]
impl<T: ArrowPrimitiveType, Ptr: Borrow<Option<<T as ArrowPrimitiveType>::Native>>> FromIterator<Ptr> for PrimitiveArray<T>
[src]
fn from_iter<I: IntoIterator<Item = Ptr>>(iter: I) -> Self
[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?
fn into_iter(self) -> Self::IntoIter
[src]
impl<T: ArrowPrimitiveType> JsonEqual for PrimitiveArray<T>
[src]
Implement array equals for numeric type
fn equals_json(&self, json: &[&Value]) -> bool
[src]
fn equals_json_values(&self, json: &[Value]) -> bool
[src]
impl<T: ArrowPrimitiveType> PartialEq<PrimitiveArray<T>> for PrimitiveArray<T>
[src]
fn eq(&self, other: &PrimitiveArray<T>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ArrowPrimitiveType> PartialEq<Value> for PrimitiveArray<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for PrimitiveArray<T> where
<T as ArrowPrimitiveType>::Native: RefUnwindSafe,
[src]
<T as ArrowPrimitiveType>::Native: RefUnwindSafe,
impl<T> Send for PrimitiveArray<T>
[src]
impl<T> Sync for PrimitiveArray<T>
[src]
impl<T> Unpin for PrimitiveArray<T>
[src]
impl<T> UnwindSafe for PrimitiveArray<T> where
<T as ArrowPrimitiveType>::Native: RefUnwindSafe,
[src]
<T as ArrowPrimitiveType>::Native: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,