pub struct ScalarSubqueryExpr { /* private fields */ }Expand description
A physical expression whose value is provided by a scalar subquery.
Subquery execution is handled by ScalarSubqueryExec, which stores the
result in a shared ScalarSubqueryResults container. This expression
simply reads from that container at the appropriate index.
Implementations§
Source§impl ScalarSubqueryExpr
impl ScalarSubqueryExpr
pub fn new( data_type: DataType, nullable: bool, index: SubqueryIndex, results: ScalarSubqueryResults, ) -> Self
pub fn data_type(&self) -> &DataType
pub fn nullable(&self) -> bool
Sourcepub fn index(&self) -> SubqueryIndex
pub fn index(&self) -> SubqueryIndex
Returns the index of this subquery in the shared results container.
pub fn results(&self) -> &ScalarSubqueryResults
Trait Implementations§
Source§impl Debug for ScalarSubqueryExpr
impl Debug for ScalarSubqueryExpr
Source§impl Display for ScalarSubqueryExpr
impl Display for ScalarSubqueryExpr
impl Eq for ScalarSubqueryExpr
Source§impl Hash for ScalarSubqueryExpr
impl Hash for ScalarSubqueryExpr
Source§impl PartialEq for ScalarSubqueryExpr
impl PartialEq for ScalarSubqueryExpr
Source§impl PhysicalExpr for ScalarSubqueryExpr
impl PhysicalExpr for ScalarSubqueryExpr
Source§fn return_field(&self, _input_schema: &Schema) -> Result<FieldRef>
fn return_field(&self, _input_schema: &Schema) -> Result<FieldRef>
The output field associated with this expression
Source§fn evaluate(&self, _batch: &RecordBatch) -> Result<ColumnarValue>
fn evaluate(&self, _batch: &RecordBatch) -> Result<ColumnarValue>
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<Self>,
_children: Vec<Arc<dyn PhysicalExpr>>,
) -> Result<Arc<dyn PhysicalExpr>>
fn with_new_children( self: Arc<Self>, _children: Vec<Arc<dyn PhysicalExpr>>, ) -> Result<Arc<dyn PhysicalExpr>>
Returns a new PhysicalExpr where all children were replaced by new exprs. Read more
Source§fn get_properties(&self, _children: &[ExprProperties]) -> Result<ExprProperties>
fn get_properties(&self, _children: &[ExprProperties]) -> Result<ExprProperties>
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 fmt_sql(&self, f: &mut Formatter<'_>) -> Result
fn fmt_sql(&self, f: &mut Formatter<'_>) -> Result
Format this
PhysicalExpr in nice human readable “SQL” format Read moreSource§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.
Returns an error if the data type cannot be determined, ex. if the
schema is missing a required field.
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_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>
👎Deprecated since 54.0.0:
Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071
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>
👎Deprecated since 54.0.0:
Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071
Updates children statistics using the given parent statistic for this
expression. Read more
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
Source§fn placement(&self) -> ExpressionPlacement
fn placement(&self) -> ExpressionPlacement
Returns placement information for this expression. Read more
Source§fn expression_id(&self) -> Option<u64>
fn expression_id(&self) -> Option<u64>
Return a stable, globally-unique identifier for this
PhysicalExpr, if it
has one. Read moreAuto Trait Implementations§
impl Freeze for ScalarSubqueryExpr
impl RefUnwindSafe for ScalarSubqueryExpr
impl Send for ScalarSubqueryExpr
impl Sync for ScalarSubqueryExpr
impl Unpin for ScalarSubqueryExpr
impl UnsafeUnpin for ScalarSubqueryExpr
impl UnwindSafe for ScalarSubqueryExpr
Blanket Implementations§
impl<T> Allocation for T
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<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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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