pub trait ArrayOperator:
'static
+ Send
+ Sync {
// Required methods
fn execute_batch(
&self,
selection: &Mask,
ctx: &mut dyn ExecutionCtx,
) -> VortexResult<Vector>;
fn reduce_children(&self) -> VortexResult<Option<ArrayRef>>;
fn reduce_parent(
&self,
parent: &ArrayRef,
child_idx: usize,
) -> VortexResult<Option<ArrayRef>>;
fn as_pipelined(&self) -> Option<&dyn PipelinedNode>;
fn bind(
&self,
selection: Option<&ArrayRef>,
ctx: &mut dyn BindCtx,
) -> VortexResult<BatchKernelRef>;
}Expand description
Array functions as provided by the OperatorVTable.
Note: the public functions such as “execute” should move onto the main Array trait when
operators is stabilized. The other functions should remain on a pub(crate) trait.
Required Methods§
Sourcefn execute_batch(
&self,
selection: &Mask,
ctx: &mut dyn ExecutionCtx,
) -> VortexResult<Vector>
fn execute_batch( &self, selection: &Mask, ctx: &mut dyn ExecutionCtx, ) -> VortexResult<Vector>
Execute the array’s batch kernel with the given selection mask.
§Panics
If the mask length does not match the array length. If the array’s implementation returns an invalid vector (wrong length, wrong type, etc.).
Sourcefn reduce_children(&self) -> VortexResult<Option<ArrayRef>>
fn reduce_children(&self) -> VortexResult<Option<ArrayRef>>
Optimize the array by running the optimization rules.
Sourcefn reduce_parent(
&self,
parent: &ArrayRef,
child_idx: usize,
) -> VortexResult<Option<ArrayRef>>
fn reduce_parent( &self, parent: &ArrayRef, child_idx: usize, ) -> VortexResult<Option<ArrayRef>>
Optimize the array by pushing down a parent array.
Sourcefn as_pipelined(&self) -> Option<&dyn PipelinedNode>
fn as_pipelined(&self) -> Option<&dyn PipelinedNode>
Returns the array as a pipeline node, if supported.
Sourcefn bind(
&self,
selection: Option<&ArrayRef>,
ctx: &mut dyn BindCtx,
) -> VortexResult<BatchKernelRef>
fn bind( &self, selection: Option<&ArrayRef>, ctx: &mut dyn BindCtx, ) -> VortexResult<BatchKernelRef>
Bind the array to a batch kernel. This is an internal function