Skip to main content

HigherOrderUDF

Struct HigherOrderUDF 

Source
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

Source

pub fn new_from_impl<F>(fun: F) -> HigherOrderUDF
where F: HigherOrderUDFImpl + 'static,

Create a new HigherOrderUDF from a HigherOrderUDFImpl trait object.

Note this is the same as using the From impl (HigherOrderUDF::from).

Source

pub fn new_from_shared_impl(fun: Arc<dyn HigherOrderUDFImpl>) -> HigherOrderUDF

Create a new HigherOrderUDF from a shared HigherOrderUDFImpl trait object.

Source

pub fn inner(&self) -> &Arc<dyn HigherOrderUDFImpl>

Return the underlying HigherOrderUDFImpl trait object for this function.

Source

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.

Source

pub fn name(&self) -> &str

Returns this function’s name.

See HigherOrderUDFImpl::name for more details.

Source

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

Returns the aliases for this function.

See HigherOrderUDF::with_aliases for more details.

Source

pub fn schema_name(&self, args: &[Expr]) -> Result<String>

Returns this function’s schema_name.

See HigherOrderUDFImpl::schema_name for more details.

Source

pub fn signature(&self) -> &HigherOrderSignature

Returns this function’s HigherOrderSignature.

Source

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.

Source

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.

Source

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.

Source

pub fn clear_null_values(&self) -> bool

Whether List or LargeList arguments should have non-empty null sublists cleaned before invoking this function.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn documentation(&self) -> Option<&Documentation>

Returns the documentation for this function, if any.

Trait Implementations§

Source§

impl Clone for HigherOrderUDF

Source§

fn clone(&self) -> HigherOrderUDF

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HigherOrderUDF

Source§

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

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

impl Eq for HigherOrderUDF

Source§

impl<F> From<F> for HigherOrderUDF
where F: HigherOrderUDFImpl + 'static,

Source§

fn from(fun: F) -> Self

Converts to this type from the input type.
Source§

impl Hash for HigherOrderUDF

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for HigherOrderUDF

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for HigherOrderUDF

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynEq for T
where T: Eq + Any,

Source§

fn dyn_eq(&self, other: &(dyn Any + 'static)) -> bool

Source§

impl<T> DynHash for T
where T: Hash + Any,

Source§

fn dyn_hash(&self, state: &mut dyn Hasher)

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.