pub(crate) struct QueryBox {
pub id: BoxId,
pub box_type: BoxType,
pub columns: Vec<Column>,
pub quantifiers: BTreeSet<QuantifierId>,
pub ranging_quantifiers: BTreeSet<QuantifierId>,
pub distinct: DistinctOperation,
pub attributes: Attributes,
}
Expand description
A semantic operator within a Query Graph.
Fields§
§id: BoxId
uniquely identifies the box within the model
box_type: BoxType
the type of the box
columns: Vec<Column>
the projection of the box
quantifiers: BTreeSet<QuantifierId>
the input quantifiers of the box
ranging_quantifiers: BTreeSet<QuantifierId>
quantifiers ranging over this box
distinct: DistinctOperation
whether this box must enforce the uniqueness of its output, it is guaranteed by structure of the box or it must preserve duplicated rows from its input boxes. See DistinctOperation.
attributes: Attributes
Derived attributes
Implementations§
source§impl QueryBox
impl QueryBox
sourcepub fn add_column(&mut self, expr: BoxScalarExpr) -> usize
pub fn add_column(&mut self, expr: BoxScalarExpr) -> usize
Append the given expression as a new column without an explicit alias in the projection of the box.
sourcepub fn add_column_if_not_exists(&mut self, expr: BoxScalarExpr) -> usize
pub fn add_column_if_not_exists(&mut self, expr: BoxScalarExpr) -> usize
Append the given expression as a new column in the projection of the box if there isn’t already a column with the same expression. Returns the position of the first column in the projection with the same expression.
sourcepub fn columns_as_refs(&self) -> Option<Vec<&ColumnReference>>
pub fn columns_as_refs(&self) -> Option<Vec<&ColumnReference>>
Returns a vector of ColumnReference
if all column expressions projected
by this QueryBox
of that form.
sourcepub fn visit_expressions<F, E>(&self, f: &mut F) -> Result<(), E>where
F: FnMut(&BoxScalarExpr) -> Result<(), E>,
pub fn visit_expressions<F, E>(&self, f: &mut F) -> Result<(), E>where
F: FnMut(&BoxScalarExpr) -> Result<(), E>,
Visit all the expressions in this query box.
sourcepub fn visit_expressions_mut<F, E>(&mut self, f: &mut F) -> Result<(), E>where
F: FnMut(&mut BoxScalarExpr) -> Result<(), E>,
pub fn visit_expressions_mut<F, E>(&mut self, f: &mut F) -> Result<(), E>where
F: FnMut(&mut BoxScalarExpr) -> Result<(), E>,
Mutably visit all the expressions in this query box.
pub fn is_select(&self) -> bool
sourcefn correlation_info(
&self,
model: &Model
) -> BTreeMap<QuantifierId, HashSet<ColumnReference>>
fn correlation_info(
&self,
model: &Model
) -> BTreeMap<QuantifierId, HashSet<ColumnReference>>
Correlation information of the quantifiers in this box. Returns a map containing, for each quantifier, the column references from sibling quantifiers they are correlated with.
sourcepub fn update_column_quantifiers(
&mut self,
updated_quantifier_ids: &HashMap<QuantifierId, QuantifierId>
)
pub fn update_column_quantifiers(
&mut self,
updated_quantifier_ids: &HashMap<QuantifierId, QuantifierId>
)
For every expression in this box, update the quantifier ids of every referenced column.
updated_quantifier_ids
should be a map of the old QuantifierId to
the new one.
source§impl QueryBox
impl QueryBox
Model
-dependent methods.
Publicly visible delegates to these methods are defined for
BoundRef<'_, QueryBox>
and BoundRefMut<'_, QueryBox>
.
sourcefn input_quantifiers<'a>(
&'a self,
model: &'a Model
) -> impl DoubleEndedIterator<Item = BoundRef<'a, Quantifier>>
fn input_quantifiers<'a>(
&'a self,
model: &'a Model
) -> impl DoubleEndedIterator<Item = BoundRef<'a, Quantifier>>
Resolve the input quantifiers of this box as an iterator of immutable bound references.
sourcefn ranging_quantifiers<'a>(
&'a self,
model: &'a Model
) -> impl DoubleEndedIterator<Item = BoundRef<'a, Quantifier>>
fn ranging_quantifiers<'a>(
&'a self,
model: &'a Model
) -> impl DoubleEndedIterator<Item = BoundRef<'a, Quantifier>>
Resolve the quantifiers ranging over this box as an iterator of immutable bound references.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for QueryBox
impl Send for QueryBox
impl Sync for QueryBox
impl Unpin for QueryBox
impl !UnwindSafe for QueryBox
Blanket Implementations§
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.