common_function::function

Trait AsyncFunction

source
pub trait AsyncFunction:
    Display
    + Sync
    + Send {
    // Required methods
    fn name(&self) -> &str;
    fn return_type(
        &self,
        input_types: &[ConcreteDataType],
    ) -> Result<ConcreteDataType>;
    fn signature(&self) -> Signature;
    fn eval<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _func_ctx: FunctionContext,
        _columns: &'life1 [VectorRef],
    ) -> Pin<Box<dyn Future<Output = Result<VectorRef>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Async Scalar function trait

Required Methods§

source

fn name(&self) -> &str

Returns the name of the function, should be unique.

source

fn return_type( &self, input_types: &[ConcreteDataType], ) -> Result<ConcreteDataType>

The returned data type of function execution.

source

fn signature(&self) -> Signature

The signature of function.

source

fn eval<'life0, 'life1, 'async_trait>( &'life0 self, _func_ctx: FunctionContext, _columns: &'life1 [VectorRef], ) -> Pin<Box<dyn Future<Output = Result<VectorRef>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Evaluate the function, e.g. run/execute the function. TODO(dennis): simplify the signature and refactor all the admin functions.

Implementors§