pub struct HigherOrderUDF { /* private fields */ }Expand description
Logical representation of a Higher Order User Defined Function.
A higher order function takes one or more lambda arguments in addition to regular value arguments. This struct contains the information DataFusion needs to plan and invoke functions you supply such as name, type signature, return type, and actual implementation.
Implementations§
Source§impl HigherOrderUDF
impl HigherOrderUDF
Sourcepub fn new_from_impl<F>(fun: F) -> HigherOrderUDFwhere
F: HigherOrderUDFImpl + 'static,
pub fn new_from_impl<F>(fun: F) -> HigherOrderUDFwhere
F: HigherOrderUDFImpl + 'static,
Create a new HigherOrderUDF from a HigherOrderUDFImpl trait object.
Note this is the same as using the From impl (HigherOrderUDF::from).
Create a new HigherOrderUDF from a shared HigherOrderUDFImpl trait object.
Sourcepub fn inner(&self) -> &Arc<dyn HigherOrderUDFImpl> ⓘ
pub fn inner(&self) -> &Arc<dyn HigherOrderUDFImpl> ⓘ
Return the underlying HigherOrderUDFImpl trait object for this function.
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.
If you implement HigherOrderUDFImpl directly you should return aliases
directly.
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns this function’s name.
See HigherOrderUDFImpl::name for more details.
Sourcepub fn aliases(&self) -> &[String]
pub fn aliases(&self) -> &[String]
Returns the aliases for this function.
See HigherOrderUDF::with_aliases for more details.
Sourcepub fn schema_name(&self, args: &[Expr]) -> Result<String>
pub fn schema_name(&self, args: &[Expr]) -> Result<String>
Returns this function’s schema_name.
See HigherOrderUDFImpl::schema_name for more details.
Sourcepub fn signature(&self) -> &HigherOrderSignature
pub fn signature(&self) -> &HigherOrderSignature
Returns this function’s HigherOrderSignature.
Sourcepub fn lambda_parameters(
&self,
step: usize,
fields: &[ValueOrLambda<FieldRef, Option<FieldRef>>],
) -> Result<LambdaParametersProgress>
pub fn lambda_parameters( &self, step: usize, fields: &[ValueOrLambda<FieldRef, Option<FieldRef>>], ) -> Result<LambdaParametersProgress>
Returns the parameters of all lambdas of this function for the current step.
See HigherOrderUDFImpl::lambda_parameters for more details.
Sourcepub fn coerce_values_for_lambdas(
&self,
fields: &[ValueOrLambda<DataType, DataType>],
) -> Result<Option<Vec<DataType>>>
pub fn coerce_values_for_lambdas( &self, fields: &[ValueOrLambda<DataType, DataType>], ) -> Result<Option<Vec<DataType>>>
Coerce value arguments based on lambda output types.
See HigherOrderUDFImpl::coerce_values_for_lambdas for more details.
Sourcepub fn return_field_from_args(
&self,
args: HigherOrderReturnFieldArgs<'_>,
) -> Result<FieldRef>
pub fn return_field_from_args( &self, args: HigherOrderReturnFieldArgs<'_>, ) -> Result<FieldRef>
Returns the return field of the function given its arguments.
See HigherOrderUDFImpl::return_field_from_args for more details.
Sourcepub fn clear_null_values(&self) -> bool
pub fn clear_null_values(&self) -> bool
Whether List or LargeList arguments should have non-empty null sublists cleaned before invoking this function.
Sourcepub fn invoke_with_args(
&self,
args: HigherOrderFunctionArgs,
) -> Result<ColumnarValue>
pub fn invoke_with_args( &self, args: HigherOrderFunctionArgs, ) -> Result<ColumnarValue>
Invoke the function returning the appropriate result.
See HigherOrderUDFImpl::invoke_with_args for more details.
Sourcepub fn short_circuits(&self) -> bool
pub fn short_circuits(&self) -> bool
Returns true if some of this function’s subexpressions may not be evaluated.
See HigherOrderUDFImpl::short_circuits for more details.
Sourcepub fn conditional_arguments<'a>(
&self,
args: &'a [Expr],
) -> Option<(Vec<&'a Expr>, Vec<&'a Expr>)>
pub fn conditional_arguments<'a>( &self, args: &'a [Expr], ) -> Option<(Vec<&'a Expr>, Vec<&'a Expr>)>
Returns which arguments are evaluated eagerly vs lazily.
See HigherOrderUDFImpl::conditional_arguments for more details.
Sourcepub fn coerce_value_types(
&self,
arg_types: &[DataType],
) -> Result<Vec<DataType>>
pub fn coerce_value_types( &self, arg_types: &[DataType], ) -> Result<Vec<DataType>>
Coerce value arguments of a function call to types that the function can evaluate.
See HigherOrderUDFImpl::coerce_value_types for more details.
Sourcepub fn documentation(&self) -> Option<&Documentation>
pub fn documentation(&self) -> Option<&Documentation>
Returns the documentation for this function, if any.
Trait Implementations§
Source§impl Clone for HigherOrderUDF
impl Clone for HigherOrderUDF
Source§fn clone(&self) -> HigherOrderUDF
fn clone(&self) -> HigherOrderUDF
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HigherOrderUDF
impl Debug for HigherOrderUDF
impl Eq for HigherOrderUDF
Source§impl<F> From<F> for HigherOrderUDFwhere
F: HigherOrderUDFImpl + 'static,
impl<F> From<F> for HigherOrderUDFwhere
F: HigherOrderUDFImpl + 'static,
Source§impl Hash for HigherOrderUDF
impl Hash for HigherOrderUDF
Source§impl PartialEq for HigherOrderUDF
impl PartialEq for HigherOrderUDF
Source§impl PartialOrd for HigherOrderUDF
impl PartialOrd for HigherOrderUDF
Auto Trait Implementations§
impl !RefUnwindSafe for HigherOrderUDF
impl !UnwindSafe for HigherOrderUDF
impl Freeze for HigherOrderUDF
impl Send for HigherOrderUDF
impl Sync for HigherOrderUDF
impl Unpin for HigherOrderUDF
impl UnsafeUnpin for HigherOrderUDF
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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