Struct datafusion::logical_expr::SimpleScalarUDF

source ·
pub struct SimpleScalarUDF { /* private fields */ }
Expand description

Implements ScalarUDFImpl for functions that have a single signature and return type.

Implementations§

source§

impl SimpleScalarUDF

source

pub fn new( name: impl Into<String>, input_types: Vec<DataType>, return_type: DataType, volatility: Volatility, fun: Arc<dyn Fn(&[ColumnarValue]) -> Result<ColumnarValue, DataFusionError> + Sync + Send> ) -> SimpleScalarUDF

Create a new SimpleScalarUDF from a name, input types, return type and implementation. Implementing ScalarUDFImpl allows more flexibility

Trait Implementations§

source§

impl Debug for SimpleScalarUDF

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl ScalarUDFImpl for SimpleScalarUDF

source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns this object as an Any trait object
source§

fn name(&self) -> &str

Returns this function’s name
source§

fn signature(&self) -> &Signature

Returns the function’s Signature for information about what input types are accepted and the function’s Volatility.
source§

fn return_type( &self, _arg_types: &[DataType] ) -> Result<DataType, DataFusionError>

What DataType will be returned by this function, given the types of the arguments. Read more
source§

fn invoke( &self, args: &[ColumnarValue] ) -> Result<ColumnarValue, DataFusionError>

Invoke the function on args, returning the appropriate result Read more
source§

fn return_type_from_exprs( &self, _args: &[Expr], _schema: &dyn ExprSchema, arg_types: &[DataType] ) -> Result<DataType, DataFusionError>

What DataType will be returned by this function, given the arguments? Read more
source§

fn invoke_no_args( &self, _number_rows: usize ) -> Result<ColumnarValue, DataFusionError>

Invoke the function without args, instead the number of rows are provided, returning the appropriate result.
source§

fn aliases(&self) -> &[String]

Returns any aliases (alternate names) for this function. Read more
source§

fn monotonicity(&self) -> Result<Option<Vec<Option<bool>>>, DataFusionError>

This function specifies monotonicity behaviors for User defined scalar functions.
source§

fn simplify( &self, args: Vec<Expr>, _info: &dyn SimplifyInfo ) -> Result<ExprSimplifyResult, DataFusionError>

Optionally apply per-UDF simplification / rewrite rules. Read more
source§

fn short_circuits(&self) -> bool

Returns true if some of this exprs subexpressions may not be evaluated and thus any side effects (like divide by zero) may not be encountered Setting this to true prevents certain optimizations such as common subexpression elimination

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V