Struct deltalake::datafusion::prelude::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
impl SimpleScalarUDF
sourcepub 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
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
impl Debug for SimpleScalarUDF
source§impl ScalarUDFImpl for SimpleScalarUDF
impl ScalarUDFImpl for SimpleScalarUDF
source§fn signature(&self) -> &Signature
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>
fn return_type( &self, _arg_types: &[DataType] ) -> Result<DataType, DataFusionError>
source§fn invoke(
&self,
args: &[ColumnarValue]
) -> Result<ColumnarValue, DataFusionError>
fn invoke( &self, args: &[ColumnarValue] ) -> Result<ColumnarValue, DataFusionError>
Invoke the function on
args
, returning the appropriate result Read moresource§fn return_type_from_exprs(
&self,
_args: &[Expr],
_schema: &dyn ExprSchema,
arg_types: &[DataType]
) -> Result<DataType, DataFusionError>
fn return_type_from_exprs( &self, _args: &[Expr], _schema: &dyn ExprSchema, arg_types: &[DataType] ) -> Result<DataType, DataFusionError>
source§fn aliases(&self) -> &[String]
fn aliases(&self) -> &[String]
Returns any aliases (alternate names) for this function. Read more
source§fn monotonicity(&self) -> Result<Option<Vec<Option<bool>>>, DataFusionError>
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>
fn simplify( &self, args: Vec<Expr>, _info: &dyn SimplifyInfo ) -> Result<ExprSimplifyResult, DataFusionError>
Optionally apply per-UDF simplification / rewrite rules. Read more
Auto Trait Implementations§
impl Freeze for SimpleScalarUDF
impl !RefUnwindSafe for SimpleScalarUDF
impl Send for SimpleScalarUDF
impl Sync for SimpleScalarUDF
impl Unpin for SimpleScalarUDF
impl !UnwindSafe for SimpleScalarUDF
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreCreates a shared type from an unshared type.