[−][src]Struct arrow::array::PrimitiveArray
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]
length: usize,
values: Buffer,
null_count: usize,
offset: usize
) -> Self
pub fn values(&self) -> Buffer
[src]
Returns a Buffer
holding all the values of this array.
Note this doesn't take the offset of this array into account.
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(&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]
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 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]
length: usize,
values: Buffer,
null_count: usize,
offset: usize
) -> Self
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]
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]
data: Vec<Option<i64>>,
timezone: Option<Arc<String>>
) -> Self
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 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]
impl<T: ArrowPrimitiveType> ArrayEqual for PrimitiveArray<T>
[src]
default fn equals(&self, other: &dyn Array) -> bool
[src]
default fn range_equals(
&self,
other: &dyn Array,
start_idx: usize,
end_idx: usize,
other_start_idx: usize
) -> bool
[src]
&self,
other: &dyn Array,
start_idx: usize,
end_idx: usize,
other_start_idx: usize
) -> bool
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]
i64: From<T::Native>,
impl Debug for PrimitiveArray<BooleanType>
[src]
impl<T: ArrowPrimitiveType> From<Arc<ArrayData>> for PrimitiveArray<T>
[src]
Constructs a PrimitiveArray
from an array data reference.
default fn from(data: ArrayDataRef) -> Self
[src]
impl From<Vec<Option<f32>>> for PrimitiveArray<Float32Type>
[src]
impl From<Vec<Option<f64>>> for PrimitiveArray<Float64Type>
[src]
impl From<Vec<Option<i16>>> for PrimitiveArray<Int16Type>
[src]
impl From<Vec<Option<i32>>> for PrimitiveArray<Int32Type>
[src]
impl From<Vec<Option<i32>>> for PrimitiveArray<Date32Type>
[src]
impl From<Vec<Option<i32>>> for PrimitiveArray<Time32SecondType>
[src]
impl From<Vec<Option<i32>>> for PrimitiveArray<Time32MillisecondType>
[src]
impl From<Vec<Option<i32>>> for PrimitiveArray<IntervalYearMonthType>
[src]
impl From<Vec<Option<i64>>> for PrimitiveArray<Int64Type>
[src]
impl From<Vec<Option<i64>>> for PrimitiveArray<Date64Type>
[src]
impl From<Vec<Option<i64>>> for PrimitiveArray<TimestampMicrosecondType>
[src]
impl From<Vec<Option<i64>>> for PrimitiveArray<Time64MicrosecondType>
[src]
impl From<Vec<Option<i64>>> for PrimitiveArray<Time64NanosecondType>
[src]
impl From<Vec<Option<i64>>> for PrimitiveArray<IntervalDayTimeType>
[src]
impl From<Vec<Option<i64>>> for PrimitiveArray<DurationSecondType>
[src]
impl From<Vec<Option<i64>>> for PrimitiveArray<DurationMillisecondType>
[src]
impl From<Vec<Option<i64>>> for PrimitiveArray<DurationMicrosecondType>
[src]
impl From<Vec<Option<i64>>> for PrimitiveArray<DurationNanosecondType>
[src]
impl From<Vec<Option<i64>>> for PrimitiveArray<TimestampMillisecondType>
[src]
impl From<Vec<Option<i8>>> for PrimitiveArray<Int8Type>
[src]
impl From<Vec<Option<u16>>> for PrimitiveArray<UInt16Type>
[src]
impl From<Vec<Option<u32>>> for PrimitiveArray<UInt32Type>
[src]
impl From<Vec<Option<u64>>> for PrimitiveArray<UInt64Type>
[src]
impl From<Vec<Option<u8>>> for PrimitiveArray<UInt8Type>
[src]
impl From<Vec<f32>> for PrimitiveArray<Float32Type>
[src]
impl From<Vec<f64>> for PrimitiveArray<Float64Type>
[src]
impl From<Vec<i16>> for PrimitiveArray<Int16Type>
[src]
impl From<Vec<i32>> for PrimitiveArray<Int32Type>
[src]
impl From<Vec<i32>> for PrimitiveArray<Date32Type>
[src]
impl From<Vec<i32>> for PrimitiveArray<Time32SecondType>
[src]
impl From<Vec<i32>> for PrimitiveArray<Time32MillisecondType>
[src]
impl From<Vec<i32>> for PrimitiveArray<IntervalYearMonthType>
[src]
impl From<Vec<i64>> for PrimitiveArray<Int64Type>
[src]
impl From<Vec<i64>> for PrimitiveArray<Date64Type>
[src]
impl From<Vec<i64>> for PrimitiveArray<TimestampMicrosecondType>
[src]
impl From<Vec<i64>> for PrimitiveArray<Time64MicrosecondType>
[src]
impl From<Vec<i64>> for PrimitiveArray<Time64NanosecondType>
[src]
impl From<Vec<i64>> for PrimitiveArray<IntervalDayTimeType>
[src]
impl From<Vec<i64>> for PrimitiveArray<DurationSecondType>
[src]
impl From<Vec<i64>> for PrimitiveArray<DurationMillisecondType>
[src]
impl From<Vec<i64>> for PrimitiveArray<DurationMicrosecondType>
[src]
impl From<Vec<i64>> for PrimitiveArray<DurationNanosecondType>
[src]
impl From<Vec<i64>> for PrimitiveArray<TimestampMillisecondType>
[src]
impl From<Vec<i8>> for PrimitiveArray<Int8Type>
[src]
impl From<Vec<u16>> for PrimitiveArray<UInt16Type>
[src]
impl From<Vec<u32>> for PrimitiveArray<UInt32Type>
[src]
impl From<Vec<u64>> for PrimitiveArray<UInt64Type>
[src]
impl From<Vec<u8>> for PrimitiveArray<UInt8Type>
[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> OrdArray for PrimitiveArray<T> where
T::Native: Ord,
[src]
T::Native: Ord,
impl PartialEq<PrimitiveArray<BooleanType>> for BooleanArray
[src]
fn eq(&self, other: &BooleanArray) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ArrowNumericType> PartialEq<PrimitiveArray<T>> for PrimitiveArray<T>
[src]
fn eq(&self, other: &PrimitiveArray<T>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ArrowPrimitiveType> PartialEq<PrimitiveArray<T>> for Value
[src]
fn eq(&self, arrow: &PrimitiveArray<T>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ArrowPrimitiveType> PartialEq<Value> for PrimitiveArray<T>
[src]
impl<T: ArrowPrimitiveType> PrimitiveArrayOps<T> for PrimitiveArray<T>
[src]
impl<T: ArrowNumericType> PrimitiveArrayOps<T> for PrimitiveArray<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for PrimitiveArray<T> where
<T as ArrowPrimitiveType>::Native: RefUnwindSafe,
<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,
<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,
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.
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.
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>,