Trait common_function::function::Function

source ·
pub trait Function: Display + Sync + Send {
    // Required methods
    fn name(&self) -> &str;
    fn return_type(
        &self,
        input_types: &[ConcreteDataType],
    ) -> Result<ConcreteDataType>;
    fn signature(&self) -> Signature;
    fn eval(
        &self,
        _func_ctx: FunctionContext,
        _columns: &[VectorRef],
    ) -> Result<VectorRef>;
}
Expand description

Scalar function trait, modified from databend to adapt datafusion TODO(dennis): optimize function by it’s features such as monotonicity etc.

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( &self, _func_ctx: FunctionContext, _columns: &[VectorRef], ) -> Result<VectorRef>

Evaluate the function, e.g. run/execute the function.

Implementors§