Struct dataflow_types::plan::join::JoinBuildState [−][src]
pub struct JoinBuildState {
column_map: HashMap<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: HashMap<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 Datum
s 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
fn new(
columns: Range<usize>,
equivalences: &[Vec<MirScalarExpr>],
mfp: &MapFilterProject
) -> Self
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.
fn add_columns(
&mut self,
new_columns: Range<usize>,
bound_expressions: &[MirScalarExpr],
thinned_arity_with_key: usize,
permutation: HashMap<usize, usize>
) -> JoinClosure
fn add_columns(
&mut self,
new_columns: Range<usize>,
bound_expressions: &[MirScalarExpr],
thinned_arity_with_key: usize,
permutation: HashMap<usize, usize>
) -> JoinClosure
Present new columns and extract any newly available closure.
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.
fn extract_closure(
&mut self,
permutation: HashMap<usize, usize>,
thinned_arity_with_key: usize
) -> JoinClosure
fn extract_closure(
&mut self,
permutation: HashMap<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
Auto Trait Implementations
impl RefUnwindSafe for JoinBuildState
impl Send for JoinBuildState
impl Sync for JoinBuildState
impl Unpin for JoinBuildState
impl UnwindSafe for JoinBuildState
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more