Skip to main content

AsyncExpression

Trait AsyncExpression 

Source
pub trait AsyncExpression: ExpressionInfo {
    // Required method
    fn eval_row<'a>(
        &'a self,
        input: &'a OwnedRow,
    ) -> impl Future<Output = Result<Datum>> + Send + 'a;

    // Provided methods
    fn eval<'a>(
        &'a self,
        input: &'a DataChunk,
    ) -> impl Future<Output = Result<ArrayRef>> + Send + 'a { ... }
    fn eval_v2<'a>(
        &'a self,
        input: &'a DataChunk,
    ) -> impl Future<Output = Result<ValueImpl>> + Send + 'a { ... }
}
Expand description

Interface of an asynchronous expression.

Required Methods§

Source

fn eval_row<'a>( &'a self, input: &'a OwnedRow, ) -> impl Future<Output = Result<Datum>> + Send + 'a

Evaluate the expression in row-based execution. Returns a nullable scalar.

Provided Methods§

Source

fn eval<'a>( &'a self, input: &'a DataChunk, ) -> impl Future<Output = Result<ArrayRef>> + Send + 'a

Evaluate the expression in vectorized execution. Returns an array.

The default implementation calls eval_v2 and always converts the result to an array.

Source

fn eval_v2<'a>( &'a self, input: &'a DataChunk, ) -> impl Future<Output = Result<ValueImpl>> + Send + 'a

Evaluate the expression in vectorized execution. Returns a value that can be either an array, or a scalar if all values in the array are the same.

The default implementation calls eval and puts the result into the Array variant.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AsyncExpression for Arc<dyn AsyncDynExpression>

Source§

async fn eval(&self, input: &DataChunk) -> Result<ArrayRef>

Source§

async fn eval_v2(&self, input: &DataChunk) -> Result<ValueImpl>

Source§

async fn eval_row(&self, input: &OwnedRow) -> Result<Datum>

Implementors§