pub struct JoinBuildState {
    column_map: BTreeMap<usize, usize>,
    equivalences: Vec<Vec<MirScalarExpr>>,
    mfp: MapFilterProject,
}
Expand description

Maintained state as we construct join dataflows.

This state primarily tracks the remaining work that has not yet been applied to a stream of partial results.

This state is meant to reconcile the logical operations that remain to apply (e.g. filtering, expressions, projection) and the physical organization of the current stream of data, which columns may be partially assembled in non-standard locations and which may already have been partially subjected to logic we need to apply.

Fields§

§column_map: BTreeMap<usize, usize>

Map from expected locations in extended output column reckoning to physical locations.

§equivalences: Vec<Vec<MirScalarExpr>>

A list of equivalence classes of expressions.

Within each equivalence class, expressions must evaluate to the same result to pass the join expression. Importantly, “the same” should be evaluated with Datums Rust equality, rather than the equality presented by the BinaryFunc equality operator. The distinction is important for null handling, at the least.

§mfp: MapFilterProject

The linear operator logic (maps, filters, and projection) that remains to be applied to the output of the join.

When we advance through the construction of the join dataflow, we may be able to peel off some of this work, ideally reducing mfp to something nearly the identity.

Implementations§

source§

impl JoinBuildState

source

fn new( columns: Range<usize>, equivalences: &[Vec<MirScalarExpr>], mfp: &MapFilterProject ) -> Self

Create a new join state and initial closure from initial values.

The initial closure can be None which indicates that it is the identity operator.

source

fn add_columns( &mut self, new_columns: Range<usize>, bound_expressions: &[MirScalarExpr], thinned_arity_with_key: usize, permutation: BTreeMap<usize, usize> ) -> JoinClosure

Present new columns and extract any newly available closure.

source

fn complete(self) -> JoinClosure

Extract a final MapFilterProject once all columns are available.

If not all columns are available this method will likely panic. This method differs from extract_closure in that it forcibly completes the join, extracting projections and expressions that may not be extracted with extract_closure (for example, literals, permutations, and repetition of output columns).

The resulting closure may be the identity operator, which can be checked with the is_identity() method.

source

fn extract_closure( &mut self, permutation: BTreeMap<usize, usize>, thinned_arity_with_key: usize ) -> JoinClosure

A method on self that extracts an available closure.

The extracted closure is not guaranteed to be non-trivial. Sensitive users should consider using the .is_identity() method to determine non-triviality.

Trait Implementations§

source§

impl Debug for JoinBuildState

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FutureExt for T

source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Pointable for T

source§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<P, R> ProtoType<R> for Pwhere R: RustType<P>,

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more