datatypes::vectors

Trait Vector

Source
pub trait Vector:
    Send
    + Sync
    + Serializable
    + Debug
    + VectorOp {
Show 17 methods // Required methods fn data_type(&self) -> ConcreteDataType; fn vector_type_name(&self) -> String; fn as_any(&self) -> &dyn Any; fn len(&self) -> usize; fn to_arrow_array(&self) -> ArrayRef; fn to_boxed_arrow_array(&self) -> Box<dyn Array>; fn validity(&self) -> Validity; fn memory_size(&self) -> usize; fn null_count(&self) -> usize; fn is_null(&self, row: usize) -> bool; fn slice(&self, offset: usize, length: usize) -> VectorRef; fn get(&self, index: usize) -> Value; fn get_ref(&self, index: usize) -> ValueRef<'_>; // Provided methods fn is_empty(&self) -> bool { ... } fn is_const(&self) -> bool { ... } fn only_null(&self) -> bool { ... } fn try_get(&self, index: usize) -> Result<Value> { ... }
}
Expand description

Vector of data values.

Required Methods§

Source

fn data_type(&self) -> ConcreteDataType

Returns the data type of the vector.

This may require heap allocation.

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.

§Implementation

This is O(1).

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.

§Panics

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

Source

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

Returns the clone of value at index.

§Panics

Panic if index is out of bound.

Source

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

Returns the reference of value at index.

§Panics

Panic if index is out of bound.

Provided Methods§

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.

Trait Implementations§

Source§

impl PartialEq<dyn Vector> for Arc<dyn Vector + '_>

Source§

fn eq(&self, other: &dyn Vector) -> 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 PartialEq for dyn Vector + '_

Source§

fn eq(&self, other: &dyn Vector) -> 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 Eq for dyn Vector + '_

Implementors§