pub struct PhysicalPlanningContext { /* private fields */ }Expand description
Context used while converting a logical plan subtree into a physical plan.
Unlike ExecutionProps, which
applies to the overall planning and execution of a query, this context can
differ between recursively planned subtrees. It currently carries:
- the state needed to create physical expressions for
Expr::ScalarSubquerynodes that read from a sharedScalarSubqueryResultscontainer, and - the qualifiers assigned to the
Expr::LambdaVariables that are in scope.
The physical planner builds this context from the set of uncorrelated scalar
subqueries it has scheduled for a subtree. It is then passed explicitly
through create_physical_expr so that function can find the slot index for
each Subquery. While planning the body of a lambda,
create_physical_expr extends the context with the lambda’s parameters via
Self::with_qualified_lambda_variables.
An empty PhysicalPlanningContext (the Default) is what every
non-physical-planner caller passes; if such a caller encounters a scalar
subquery, create_physical_expr returns a not_impl_err.
Implementations§
Source§impl PhysicalPlanningContext
impl PhysicalPlanningContext
Sourcepub fn new(
indexes: HashMap<Subquery, SubqueryIndex>,
results: ScalarSubqueryResults,
) -> Self
pub fn new( indexes: HashMap<Subquery, SubqueryIndex>, results: ScalarSubqueryResults, ) -> Self
Create a PhysicalPlanningContext from an index map and a shared
results container. The index map must use the same indices as slots in
results.
Sourcepub fn index_of(&self, subquery: &Subquery) -> Option<SubqueryIndex>
pub fn index_of(&self, subquery: &Subquery) -> Option<SubqueryIndex>
Returns the slot index assigned to subquery, if any.
Sourcepub fn results(&self) -> &ScalarSubqueryResults
pub fn results(&self) -> &ScalarSubqueryResults
Returns the shared results container.
Sourcepub fn with_qualified_lambda_variables(
self,
qualifier: &TableReference,
variables: &[String],
) -> Self
pub fn with_qualified_lambda_variables( self, qualifier: &TableReference, variables: &[String], ) -> Self
Adds a mapping for each variable to the given qualifier. Existing variables with conflicting names are shadowed.
Sourcepub fn lambda_variable_qualifier(&self, name: &str) -> Option<&TableReference>
pub fn lambda_variable_qualifier(&self, name: &str) -> Option<&TableReference>
Returns the qualifier of the lambda variable name, if it is in scope.
Trait Implementations§
Source§impl Clone for PhysicalPlanningContext
impl Clone for PhysicalPlanningContext
Source§fn clone(&self) -> PhysicalPlanningContext
fn clone(&self) -> PhysicalPlanningContext
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 PhysicalPlanningContext
impl Debug for PhysicalPlanningContext
Source§impl Default for PhysicalPlanningContext
impl Default for PhysicalPlanningContext
Source§fn default() -> PhysicalPlanningContext
fn default() -> PhysicalPlanningContext
Auto Trait Implementations§
impl !RefUnwindSafe for PhysicalPlanningContext
impl !UnwindSafe for PhysicalPlanningContext
impl Freeze for PhysicalPlanningContext
impl Send for PhysicalPlanningContext
impl Sync for PhysicalPlanningContext
impl Unpin for PhysicalPlanningContext
impl UnsafeUnpin for PhysicalPlanningContext
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<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