Skip to main content

MaterializedCte

Struct MaterializedCte 

Source
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:

  1. 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.
  2. continuation: the query that declared the CTE.

Fields§

§id: MaterializedCteId

Binds the scans in continuation to this node

§name: String

Name 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

Source

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.

Source

pub fn id(&self) -> MaterializedCteId

The id that binds the scans in the continuation to this node.

Source

pub fn name(&self) -> &str

The name of the CTE.

Source

pub fn body(&self) -> &Arc<LogicalPlan> ⓘ

The body of the CTE, which is computed once.

Source

pub fn continuation(&self) -> &Arc<LogicalPlan> ⓘ

The query that declared the CTE. It gives this node its output.

Source

pub fn schema(&self) -> &DFSchemaRef

The schema of this node, which is the schema of the continuation.

Source

pub fn scans(&self) -> Result<Vec<MaterializedCteScan>>

The scans in the continuation that read this CTE, also in subquery expressions. See MaterializedCteScan::find_in.

Source

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

Source§

fn clone(&self) -> Self

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 MaterializedCte

Source§

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

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

impl Eq for MaterializedCte

Source§

impl Hash for MaterializedCte

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 MaterializedCte

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
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.

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
Source§

impl StructuralPartialEq for MaterializedCte

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.