Struct mz_expr::linear::plan::SafeMfpPlan
source · pub struct SafeMfpPlan {
pub(crate) mfp: MapFilterProject,
}
Expand description
A wrapper type which indicates it is safe to simply evaluate all expressions.
Fields§
§mfp: MapFilterProject
Implementations§
source§impl SafeMfpPlan
impl SafeMfpPlan
sourcepub fn permute_fn<F>(&mut self, remap: F, new_arity: usize)
pub fn permute_fn<F>(&mut self, remap: F, new_arity: usize)
Remaps references to input columns according to remap
.
Leaves other column references, e.g. to newly mapped columns, unchanged.
sourcepub fn evaluate_into<'a, 'row>(
&'a self,
datums: &mut Vec<Datum<'a>>,
arena: &'a RowArena,
row_buf: &'row mut Row,
) -> Result<Option<Row>, EvalError>
pub fn evaluate_into<'a, 'row>( &'a self, datums: &mut Vec<Datum<'a>>, arena: &'a RowArena, row_buf: &'row mut Row, ) -> Result<Option<Row>, EvalError>
Evaluates the linear operator on a supplied list of datums.
The arguments are the initial datums associated with the row, and an appropriately lifetimed arena for temporary allocations needed by scalar evaluation.
An Ok
result will either be None
if any predicate did not
evaluate to Datum::True
, or the values of the columns listed
by self.projection
if all predicates passed. If an error
occurs in the evaluation it is returned as an Err
variant.
As the evaluation exits early with failed predicates, it may
miss some errors that would occur later in evaluation.
The row
is not cleared first, but emptied if the function
returns `Ok(Some(row)).
sourcepub fn evaluate_iter<'b, 'a: 'b>(
&'a self,
datums: &'b mut Vec<Datum<'a>>,
arena: &'a RowArena,
) -> Result<Option<impl Iterator<Item = Datum<'a>> + 'b>, EvalError>
pub fn evaluate_iter<'b, 'a: 'b>( &'a self, datums: &'b mut Vec<Datum<'a>>, arena: &'a RowArena, ) -> Result<Option<impl Iterator<Item = Datum<'a>> + 'b>, EvalError>
A version of evaluate
which produces an iterator over Datum
as output.
This version can be useful when one wants to capture the resulting datums without packing and then unpacking a row.
sourcepub fn evaluate_inner<'b, 'a: 'b>(
&'a self,
datums: &'b mut Vec<Datum<'a>>,
arena: &'a RowArena,
) -> Result<bool, EvalError>
pub fn evaluate_inner<'b, 'a: 'b>( &'a self, datums: &'b mut Vec<Datum<'a>>, arena: &'a RowArena, ) -> Result<bool, EvalError>
Populates datums
with self.expressions
and tests self.predicates
.
This does not apply self.projection
, which is up to the calling method.
sourcepub fn could_error(&self) -> bool
pub fn could_error(&self) -> bool
Returns true if evaluation could introduce an error on non-error inputs.
sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Returns true when Self
is the identity.
Methods from Deref<Target = MapFilterProject>§
sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
True if the operator describes the identity transformation.
sourcepub fn as_map_filter_project(
&self,
) -> (Vec<MirScalarExpr>, Vec<MirScalarExpr>, Vec<usize>)
pub fn as_map_filter_project( &self, ) -> (Vec<MirScalarExpr>, Vec<MirScalarExpr>, Vec<usize>)
As the arguments to Map
, Filter
, and Project
operators.
In principle, this operator can be implemented as a sequence of more elemental operators, likely less efficiently.
sourcepub fn literal_constraint(&self, expr: &MirScalarExpr) -> Option<Datum<'_>>
pub fn literal_constraint(&self, expr: &MirScalarExpr) -> Option<Datum<'_>>
Determines if a scalar expression must be equal to a literal datum.
sourcepub fn literal_constraints(&self, exprs: &[MirScalarExpr]) -> Option<Row>
pub fn literal_constraints(&self, exprs: &[MirScalarExpr]) -> Option<Row>
Determines if a sequence of scalar expressions must be equal to a literal row.
This method returns None
on an empty exprs
, which might be surprising, but
seems to line up with its callers’ expectations of that being a non-constraint.
The caller knows if exprs
is empty, and can modify their behavior appropriately.
if they would rather have a literal empty row.
Trait Implementations§
source§impl Arbitrary for SafeMfpPlan
impl Arbitrary for SafeMfpPlan
§type Parameters = <MapFilterProject as Arbitrary>::Parameters
type Parameters = <MapFilterProject as Arbitrary>::Parameters
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<<MapFilterProject as Arbitrary>::Strategy, fn(_: MapFilterProject) -> SafeMfpPlan>
type Strategy = Map<<MapFilterProject as Arbitrary>::Strategy, fn(_: MapFilterProject) -> SafeMfpPlan>
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl Clone for SafeMfpPlan
impl Clone for SafeMfpPlan
source§fn clone(&self) -> SafeMfpPlan
fn clone(&self) -> SafeMfpPlan
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SafeMfpPlan
impl Debug for SafeMfpPlan
source§impl Deref for SafeMfpPlan
impl Deref for SafeMfpPlan
source§impl<'de> Deserialize<'de> for SafeMfpPlan
impl<'de> Deserialize<'de> for SafeMfpPlan
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Ord for SafeMfpPlan
impl Ord for SafeMfpPlan
source§fn cmp(&self, other: &SafeMfpPlan) -> Ordering
fn cmp(&self, other: &SafeMfpPlan) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for SafeMfpPlan
impl PartialEq for SafeMfpPlan
source§impl PartialOrd for SafeMfpPlan
impl PartialOrd for SafeMfpPlan
source§impl RustType<ProtoSafeMfpPlan> for SafeMfpPlan
impl RustType<ProtoSafeMfpPlan> for SafeMfpPlan
source§fn into_proto(&self) -> ProtoSafeMfpPlan
fn into_proto(&self) -> ProtoSafeMfpPlan
Self
into a Proto
value.source§fn from_proto(proto: ProtoSafeMfpPlan) -> Result<Self, TryFromProtoError>
fn from_proto(proto: ProtoSafeMfpPlan) -> Result<Self, TryFromProtoError>
source§fn into_proto_owned(self) -> Proto
fn into_proto_owned(self) -> Proto
Self::into_proto
that types can
optionally implement, otherwise, the default implementation
delegates to Self::into_proto
.source§impl Serialize for SafeMfpPlan
impl Serialize for SafeMfpPlan
impl Eq for SafeMfpPlan
impl StructuralPartialEq for SafeMfpPlan
Auto Trait Implementations§
impl Freeze for SafeMfpPlan
impl RefUnwindSafe for SafeMfpPlan
impl Send for SafeMfpPlan
impl Sync for SafeMfpPlan
impl Unpin for SafeMfpPlan
impl UnwindSafe for SafeMfpPlan
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> PreferredContainer for T
impl<T> PreferredContainer for T
source§impl<T> ProgressEventTimestamp for T
impl<T> ProgressEventTimestamp 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
.source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.