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§
sourcefn return_type(
&self,
input_types: &[ConcreteDataType],
) -> Result<ConcreteDataType>
fn return_type( &self, input_types: &[ConcreteDataType], ) -> Result<ConcreteDataType>
The returned data type of function execution.
sourcefn eval(
&self,
_func_ctx: FunctionContext,
_columns: &[VectorRef],
) -> Result<VectorRef>
fn eval( &self, _func_ctx: FunctionContext, _columns: &[VectorRef], ) -> Result<VectorRef>
Evaluate the function, e.g. run/execute the function.