pub struct MaterializedCte {
pub id: MaterializedCteId,
pub name: String,
pub cte: Arc<LogicalPlan>,
pub continuation: Arc<LogicalPlan>,
}Expand description
Computes cte once and evaluates continuation, in which every
MaterializedCteScan with the same id reads the buffered output of
cte. The output of this node is the output of continuation.
The node has two inputs with different roles, in this order:
cte: the body of the CTE. It is shared by all the scans, so a rule must not change its schema, and must not push into it a filter, limit or projection that belongs to one scan only.continuation: the query that declared the CTE.
Fields§
§id: MaterializedCteIdBinds the scans in continuation to this node
name: StringName of the CTE, used for display and error messages only
cte: Arc<LogicalPlan>The body of the CTE
continuation: Arc<LogicalPlan>The query that declared the CTE and reads it
Implementations§
Source§impl MaterializedCte
impl MaterializedCte
Sourcepub fn try_new(
id: MaterializedCteId,
name: impl Into<String>,
cte: Arc<LogicalPlan>,
continuation: Arc<LogicalPlan>,
) -> Result<Self>
pub fn try_new( id: MaterializedCteId, name: impl Into<String>, cte: Arc<LogicalPlan>, continuation: Arc<LogicalPlan>, ) -> Result<Self>
Create a new node.
Returns an error if a scan of this CTE in continuation (also in a
subquery expression) does not have the column names and types of cte.
Sourcepub fn id(&self) -> MaterializedCteId
pub fn id(&self) -> MaterializedCteId
The id that binds the scans in the continuation to this node.
Sourcepub fn body(&self) -> &Arc<LogicalPlan> ⓘ
pub fn body(&self) -> &Arc<LogicalPlan> ⓘ
The body of the CTE, which is computed once.
Sourcepub fn continuation(&self) -> &Arc<LogicalPlan> ⓘ
pub fn continuation(&self) -> &Arc<LogicalPlan> ⓘ
The query that declared the CTE. It gives this node its output.
Sourcepub fn schema(&self) -> &DFSchemaRef
pub fn schema(&self) -> &DFSchemaRef
The schema of this node, which is the schema of the continuation.
Sourcepub fn scans(&self) -> Result<Vec<MaterializedCteScan>>
pub fn scans(&self) -> Result<Vec<MaterializedCteScan>>
The scans in the continuation that read this CTE, also in subquery
expressions. See MaterializedCteScan::find_in.
Sourcepub fn with_new_inputs(
&self,
cte: Arc<LogicalPlan>,
continuation: Arc<LogicalPlan>,
) -> Self
pub fn with_new_inputs( &self, cte: Arc<LogicalPlan>, continuation: Arc<LogicalPlan>, ) -> Self
Return a node with the same id and name, and new inputs. The schemas of the scans are not checked again.
Trait Implementations§
Source§impl Clone for MaterializedCte
impl Clone for MaterializedCte
Source§impl Debug for MaterializedCte
impl Debug for MaterializedCte
impl Eq for MaterializedCte
Source§impl Hash for MaterializedCte
impl Hash for MaterializedCte
Source§impl PartialEq for MaterializedCte
impl PartialEq for MaterializedCte
Source§impl PartialOrd for MaterializedCte
Orders by id and name. Nodes with the same id and name but a
different cte or continuation are not comparable, so Some(Equal) is
returned only for equal nodes.
impl PartialOrd for MaterializedCte
Orders by id and name. Nodes with the same id and name but a
different cte or continuation are not comparable, so Some(Equal) is
returned only for equal nodes.
impl StructuralPartialEq for MaterializedCte
Auto Trait Implementations§
impl !RefUnwindSafe for MaterializedCte
impl !UnwindSafe for MaterializedCte
impl Forget for MaterializedCte
impl Freeze for MaterializedCte
impl Move for MaterializedCte
impl Send for MaterializedCte
impl Sync for MaterializedCte
impl Unpin for MaterializedCte
impl UnsafeUnpin for MaterializedCte
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