pub trait Executable: Sized {
// Required method
fn execute(array: ArrayRef, ctx: &mut ExecutionCtx) -> VortexResult<Self>;
}Expand description
Marker trait for types that an ArrayRef can be executed into.
Implementors must provide an implementation of execute that takes
an ArrayRef and an ExecutionCtx, and produces an instance of the
implementor type.
Users should use the Array::execute or Array::execute_as methods
Required Methods§
fn execute(array: ArrayRef, ctx: &mut ExecutionCtx) -> VortexResult<Self>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl Executable for Mask
impl Executable for Mask
fn execute(array: ArrayRef, ctx: &mut ExecutionCtx) -> VortexResult<Self>
Source§impl<T: NativePType> Executable for Buffer<T>
Execute a primitive typed array into a buffer of native values, assuming all values are valid.
impl<T: NativePType> Executable for Buffer<T>
Execute a primitive typed array into a buffer of native values, assuming all values are valid.
§Errors
Returns a VortexError if the array is not all-valid (has any nulls).
fn execute(array: ArrayRef, ctx: &mut ExecutionCtx) -> VortexResult<Self>
Implementors§
impl Executable for Canonical
Recursively execute the array until it reaches canonical form.
Callers should prefer to execute into Columnar if they are able to optimize their use for
constant arrays.
impl Executable for Columnar
Executing into a Columnar is implemented by repeatedly executing the array until we
converge on either a constant or canonical.
For safety, we will error when the number of execution iterations reaches 128. We may want this to be configurable in the future in case of highly complex array trees, but in practice we don’t expect to ever reach this limit.
impl Executable for BoolArray
Execute the array to canonical form and unwrap as a BoolArray.
This will panic if the array’s dtype is not bool.
impl Executable for DecimalArray
Execute the array to canonical form and unwrap as a DecimalArray.
This will panic if the array’s dtype is not decimal.
impl Executable for ExtensionArray
Execute the array to canonical form and unwrap as an ExtensionArray.
This will panic if the array’s dtype is not an extension type.
impl Executable for FixedSizeListArray
Execute the array to canonical form and unwrap as a FixedSizeListArray.
This will panic if the array’s dtype is not fixed size list.
impl Executable for ListViewArray
Execute the array to canonical form and unwrap as a ListViewArray.
This will panic if the array’s dtype is not list.
impl Executable for NullArray
Execute the array to canonical form and unwrap as a NullArray.
This will panic if the array’s dtype is not null.
impl Executable for PrimitiveArray
Execute the array to canonical form and unwrap as a PrimitiveArray.
This will panic if the array’s dtype is not primitive.
impl Executable for StructArray
Execute the array to canonical form and unwrap as a StructArray.
This will panic if the array’s dtype is not struct.
impl Executable for VarBinViewArray
Execute the array to canonical form and unwrap as a VarBinViewArray.
This will panic if the array’s dtype is not utf8 or binary.
impl Executable for CanonicalValidity
impl Executable for RecursiveCanonical
impl Executable for ArrayRef
It attempts to take the smallest possible step of execution such that the returned array is incrementally more “executed” than the input array. In other words, it is closer to becoming a canonical array.
The execution steps are as follows: 0. Check for canonical.
- Attempt to call
reduce_parenton each child. - Attempt to
reducethe array with metadata-only optimizations. - Attempt to call
execute_parenton each child. - Call
executeon the array itself.
Most users will not call this method directly, instead preferring to specify an executable
target such as crate::Columnar, Canonical, or any of the canonical array types (such as
crate::arrays::PrimitiveArray).