pub trait VectorOp {
// Required methods
fn replicate(&self, offsets: &[usize]) -> VectorRef;
fn filter(&self, filter: &BooleanVector) -> Result<VectorRef>;
fn cast(&self, to_type: &ConcreteDataType) -> Result<VectorRef>;
fn take(&self, indices: &UInt32Vector) -> Result<VectorRef>;
}Expand description
Vector compute operations.
Required Methods§
Sourcefn replicate(&self, offsets: &[usize]) -> VectorRef
fn replicate(&self, offsets: &[usize]) -> VectorRef
Copies each element according offsets parameter.
i-thelement should be copiedoffsets[i] - offsets[i - 1]times0-thelement would be copiedoffsets[0]times
§Panics
Panics if offsets.len() != self.len().
Sourcefn filter(&self, filter: &BooleanVector) -> Result<VectorRef>
fn filter(&self, filter: &BooleanVector) -> Result<VectorRef>
Filters the vector, returns elements matching the filter (i.e. where the values are true).
Note that the nulls of filter are interpreted as false will lead to these elements being masked out.
Sourcefn cast(&self, to_type: &ConcreteDataType) -> Result<VectorRef>
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.
TODO(dennis) describe behaviors in details.