Struct datafusion_expr::ScalarUDF
source · pub struct ScalarUDF { /* private fields */ }Expand description
Logical representation of a Scalar User Defined Function.
A scalar function produces a single row output for each row of input.
This struct contains the information DataFusion needs to plan and invoke functions such name, type signature, return type, and actual implementation.
Implementations§
source§impl ScalarUDF
impl ScalarUDF
sourcepub fn new(
name: &str,
signature: &Signature,
return_type: &ReturnTypeFunction,
fun: &ScalarFunctionImplementation
) -> Self
pub fn new( name: &str, signature: &Signature, return_type: &ReturnTypeFunction, fun: &ScalarFunctionImplementation ) -> Self
Create a new ScalarUDF
sourcepub fn with_aliases(
self,
aliases: impl IntoIterator<Item = &'static str>
) -> Self
pub fn with_aliases( self, aliases: impl IntoIterator<Item = &'static str> ) -> Self
Adds additional names that can be used to invoke this function, in addition to name
sourcepub fn call(&self, args: Vec<Expr>) -> Expr
pub fn call(&self, args: Vec<Expr>) -> Expr
creates a logical expression with a call of the UDF This utility allows using the UDF without requiring access to the registry.
sourcepub fn aliases(&self) -> &[String]
pub fn aliases(&self) -> &[String]
Returns the aliases for this function. See ScalarUDF::with_aliases for more details
sourcepub fn signature(&self) -> &Signature
pub fn signature(&self) -> &Signature
Returns this function’s signature (what input types are accepted)
sourcepub fn return_type(&self, args: &[DataType]) -> Result<DataType>
pub fn return_type(&self, args: &[DataType]) -> Result<DataType>
Return the type of the function given its input types
sourcepub fn fun(&self) -> ScalarFunctionImplementation
pub fn fun(&self) -> ScalarFunctionImplementation
Return the actual implementation
Trait Implementations§
source§impl PartialEq for ScalarUDF
impl PartialEq for ScalarUDF
impl Eq for ScalarUDF
Auto Trait Implementations§
impl !RefUnwindSafe for ScalarUDF
impl Send for ScalarUDF
impl Sync for ScalarUDF
impl Unpin for ScalarUDF
impl !UnwindSafe for ScalarUDF
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.