datatypes::vectors

Type Alias Int8Vector

Source
pub type Int8Vector = PrimitiveVector<Int8Type>;

Aliased Type§

struct Int8Vector {
    array: PrimitiveArray<Int8Type>,
}

Fields§

§array: PrimitiveArray<Int8Type>

Implementations

Source§

impl<T: LogicalPrimitiveType> PrimitiveVector<T>

Source

pub fn new(array: PrimitiveArray<T::ArrowPrimitive>) -> Self

Source

pub fn try_from_arrow_array(array: impl AsRef<dyn Array>) -> Result<Self>

Source

pub fn from_slice<P: AsRef<[T::Native]>>(slice: P) -> Self

Source

pub fn from_wrapper_slice<P: AsRef<[T::Wrapper]>>(slice: P) -> Self

Source

pub fn from_vec(vector: Vec<T::Native>) -> Self

Source

pub fn from_iter_values<I: IntoIterator<Item = T::Native>>(iter: I) -> Self

Source

pub fn from_values<I: IntoIterator<Item = T::Native>>(iter: I) -> Self

Source

pub fn as_arrow(&self) -> &PrimitiveArray<T::ArrowPrimitive>

Get the inner arrow array.

Source

pub fn get_slice(&self, offset: usize, length: usize) -> Self

Slice the vector, returning a new vector.

§Panics

This function panics if offset + length > self.len().

Trait Implementations

Source§

impl<T: LogicalPrimitiveType> Debug for PrimitiveVector<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: LogicalPrimitiveType> From<PrimitiveArray<<T as LogicalPrimitiveType>::ArrowPrimitive>> for PrimitiveVector<T>

Source§

fn from(array: PrimitiveArray<T::ArrowPrimitive>) -> Self

Converts to this type from the input type.
Source§

impl<T: LogicalPrimitiveType> From<Vec<Option<<T as LogicalPrimitiveType>::Native>>> for PrimitiveVector<T>

Source§

fn from(v: Vec<Option<T::Native>>) -> Self

Converts to this type from the input type.
Source§

impl<T: LogicalPrimitiveType> PartialEq for PrimitiveVector<T>

Source§

fn eq(&self, other: &PrimitiveVector<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: LogicalPrimitiveType> ScalarVector for PrimitiveVector<T>

Source§

type OwnedItem = <T as LogicalPrimitiveType>::Wrapper

Source§

type RefItem<'a> = <T as LogicalPrimitiveType>::Wrapper

The reference item of this vector.
Source§

type Iter<'a> = PrimitiveIter<'a, T>

Iterator type of this vector.
Source§

type Builder = PrimitiveVectorBuilder<T>

Builder type to build this vector.
Source§

fn get_data(&self, idx: usize) -> Option<Self::RefItem<'_>>

Returns the reference to an element at given position. Read more
Source§

fn iter_data(&self) -> Self::Iter<'_>

Returns iterator of current vector.
Source§

fn from_slice(data: &[Self::RefItem<'_>]) -> Self

Source§

fn from_iterator<'a>(it: impl Iterator<Item = Self::RefItem<'a>>) -> Self

Source§

fn from_owned_iterator( it: impl Iterator<Item = Option<Self::OwnedItem>>, ) -> Self

Source§

fn from_vec<I: Into<Self::OwnedItem>>(values: Vec<I>) -> Self

Source§

impl<T: LogicalPrimitiveType> Serializable for PrimitiveVector<T>

Source§

fn serialize_to_json(&self) -> Result<Vec<JsonValue>>

Serialize a column of value with given type to JSON value
Source§

impl<T: LogicalPrimitiveType> Vector for PrimitiveVector<T>

Source§

fn data_type(&self) -> ConcreteDataType

Returns the data type of the vector. Read more
Source§

fn vector_type_name(&self) -> String

Source§

fn as_any(&self) -> &dyn Any

Returns the vector as Any so that it can be downcast to a specific implementation.
Source§

fn len(&self) -> usize

Returns number of elements in the vector.
Source§

fn to_arrow_array(&self) -> ArrayRef

Convert this vector to a new arrow [ArrayRef].
Source§

fn to_boxed_arrow_array(&self) -> Box<dyn Array>

Convert this vector to a new boxed arrow [Array].
Source§

fn validity(&self) -> Validity

Returns the validity of the Array.
Source§

fn memory_size(&self) -> usize

Returns the memory size of vector.
Source§

fn null_count(&self) -> usize

The number of null slots on this Vector. Read more
Source§

fn is_null(&self, row: usize) -> bool

Returns whether row is null.
Source§

fn slice(&self, offset: usize, length: usize) -> VectorRef

Slices the Vector, returning a new VectorRef. Read more
Source§

fn get(&self, index: usize) -> Value

Returns the clone of value at index. Read more
Source§

fn get_ref(&self, index: usize) -> ValueRef<'_>

Returns the reference of value at index. Read more
Source§

fn is_empty(&self) -> bool

Returns whether the vector is empty.
Source§

fn is_const(&self) -> bool

Returns true when it’s a ConstantColumn
Source§

fn only_null(&self) -> bool

If the vector only contains NULL.
Source§

fn try_get(&self, index: usize) -> Result<Value>

Returns the clone of value at index or error if index is out of bound.
Source§

impl<T: LogicalPrimitiveType> VectorOp for PrimitiveVector<T>

Source§

fn replicate(&self, offsets: &[usize]) -> VectorRef

Copies each element according offsets parameter. Read more
Source§

fn filter(&self, filter: &BooleanVector) -> Result<VectorRef>

Filters the vector, returns elements matching the filter (i.e. where the values are true). Read more
Source§

fn cast(&self, to_type: &ConcreteDataType) -> Result<VectorRef>

Cast vector to the provided data type and return a new vector with type to_type, if possible. Read more
Source§

fn take(&self, indices: &UInt32Vector) -> Result<VectorRef>

Take elements from the vector by the given indices. Read more