pub struct LambdaExpr {
params: Vec<String>,
body: Arc<dyn PhysicalExpr>,
captures: OnceLock<HashSet<usize>>,
}Expand description
Represents a lambda with the given parameters name and body
Fields§
§params: Vec<String>§body: Arc<dyn PhysicalExpr>§captures: OnceLock<HashSet<usize>>Implementations§
Source§impl LambdaExpr
impl LambdaExpr
Sourcepub fn new(params: Vec<String>, body: Arc<dyn PhysicalExpr>) -> LambdaExpr
pub fn new(params: Vec<String>, body: Arc<dyn PhysicalExpr>) -> LambdaExpr
Create a new lambda expression with the given parameters and body
Sourcepub fn body(&self) -> &Arc<dyn PhysicalExpr>
pub fn body(&self) -> &Arc<dyn PhysicalExpr>
Get the lambda’s body
pub fn captures(&self) -> &HashSet<usize>
Trait Implementations§
Source§impl Clone for LambdaExpr
impl Clone for LambdaExpr
Source§fn clone(&self) -> LambdaExpr
fn clone(&self) -> LambdaExpr
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LambdaExpr
impl Debug for LambdaExpr
Source§impl Display for LambdaExpr
impl Display for LambdaExpr
Source§impl Hash for LambdaExpr
impl Hash for LambdaExpr
Source§impl PartialEq for LambdaExpr
impl PartialEq for LambdaExpr
Source§impl PhysicalExpr for LambdaExpr
impl PhysicalExpr for LambdaExpr
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Returns the physical expression as
Any so that it can be
downcast to a specific implementation.Source§fn data_type(&self, _input_schema: &Schema) -> Result<DataType, DataFusionError>
fn data_type(&self, _input_schema: &Schema) -> Result<DataType, DataFusionError>
Get the data type of this expression, given the schema of the input
Source§fn nullable(&self, _input_schema: &Schema) -> Result<bool, DataFusionError>
fn nullable(&self, _input_schema: &Schema) -> Result<bool, DataFusionError>
Determine whether this expression is nullable, given the schema of the input
Source§fn evaluate(
&self,
_batch: &RecordBatch,
) -> Result<ColumnarValue, DataFusionError>
fn evaluate( &self, _batch: &RecordBatch, ) -> Result<ColumnarValue, DataFusionError>
Evaluate an expression against a RecordBatch
Source§fn children(&self) -> Vec<&Arc<dyn PhysicalExpr>>
fn children(&self) -> Vec<&Arc<dyn PhysicalExpr>>
Get a list of child PhysicalExpr that provide the input for this expr.
Source§fn with_new_children(
self: Arc<LambdaExpr>,
children: Vec<Arc<dyn PhysicalExpr>>,
) -> Result<Arc<dyn PhysicalExpr>, DataFusionError>
fn with_new_children( self: Arc<LambdaExpr>, children: Vec<Arc<dyn PhysicalExpr>>, ) -> Result<Arc<dyn PhysicalExpr>, DataFusionError>
Returns a new PhysicalExpr where all children were replaced by new exprs.
Source§fn fmt_sql(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_sql(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Format this
PhysicalExpr in nice human readable “SQL” format Read moreSource§fn return_field(
&self,
input_schema: &Schema,
) -> Result<Arc<Field>, DataFusionError>
fn return_field( &self, input_schema: &Schema, ) -> Result<Arc<Field>, DataFusionError>
The output field associated with this expression
Source§fn evaluate_selection(
&self,
batch: &RecordBatch,
selection: &BooleanArray,
) -> Result<ColumnarValue, DataFusionError>
fn evaluate_selection( &self, batch: &RecordBatch, selection: &BooleanArray, ) -> Result<ColumnarValue, DataFusionError>
Evaluate an expression against a RecordBatch after first applying a validity array Read more
Source§fn evaluate_bounds(
&self,
_children: &[&Interval],
) -> Result<Interval, DataFusionError>
fn evaluate_bounds( &self, _children: &[&Interval], ) -> Result<Interval, DataFusionError>
Computes the output interval for the expression, given the input
intervals. Read more
Source§fn propagate_constraints(
&self,
_interval: &Interval,
_children: &[&Interval],
) -> Result<Option<Vec<Interval>>, DataFusionError>
fn propagate_constraints( &self, _interval: &Interval, _children: &[&Interval], ) -> Result<Option<Vec<Interval>>, DataFusionError>
Updates bounds for child expressions, given a known interval for this
expression. Read more
Source§fn evaluate_statistics(
&self,
children: &[&Distribution],
) -> Result<Distribution, DataFusionError>
fn evaluate_statistics( &self, children: &[&Distribution], ) -> Result<Distribution, DataFusionError>
Computes the output statistics for the expression, given the input
statistics. Read more
Source§fn propagate_statistics(
&self,
parent: &Distribution,
children: &[&Distribution],
) -> Result<Option<Vec<Distribution>>, DataFusionError>
fn propagate_statistics( &self, parent: &Distribution, children: &[&Distribution], ) -> Result<Option<Vec<Distribution>>, DataFusionError>
Updates children statistics using the given parent statistic for this
expression. Read more
Source§fn get_properties(
&self,
_children: &[ExprProperties],
) -> Result<ExprProperties, DataFusionError>
fn get_properties( &self, _children: &[ExprProperties], ) -> Result<ExprProperties, DataFusionError>
Calculates the properties of this
PhysicalExpr based on its
children’s properties (i.e. order and range), recursively aggregating
the information from its children. In cases where the PhysicalExpr
has no children (e.g., Literal or Column), these properties should
be specified externally, as the function defaults to unknown properties.Source§fn snapshot(&self) -> Result<Option<Arc<dyn PhysicalExpr>>, DataFusionError>
fn snapshot(&self) -> Result<Option<Arc<dyn PhysicalExpr>>, DataFusionError>
Take a snapshot of this
PhysicalExpr, if it is dynamic. Read moreSource§fn snapshot_generation(&self) -> u64
fn snapshot_generation(&self) -> u64
Returns the generation of this
PhysicalExpr for snapshotting purposes.
The generation is an arbitrary u64 that can be used to track changes
in the state of the PhysicalExpr over time without having to do an exhaustive comparison.
This is useful to avoid unnecessary computation or serialization if there are no changes to the expression.
In particular, dynamic expressions that may change over time; this allows cheap checks for changes.
Static expressions that do not change over time should return 0, as does the default implementation.
You should not call this method directly as it does not handle recursion.
Instead use snapshot_generation to handle recursion and capture the
full state of the PhysicalExpr.Source§fn is_volatile_node(&self) -> bool
fn is_volatile_node(&self) -> bool
Returns true if the expression node is volatile, i.e. whether it can return
different results when evaluated multiple times with the same input. Read more
impl Eq for LambdaExpr
Auto Trait Implementations§
impl !Freeze for LambdaExpr
impl !RefUnwindSafe for LambdaExpr
impl Send for LambdaExpr
impl Sync for LambdaExpr
impl Unpin for LambdaExpr
impl !UnwindSafe for LambdaExpr
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.§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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.