pub struct ConstExpr {
pub expr: Arc<dyn PhysicalExpr>,
pub across_partitions: AcrossPartitions,
}Expand description
A structure representing a expression known to be constant in a physical execution plan.
The ConstExpr struct encapsulates an expression that is constant during
the execution of a query. For example if a filter like A = 5 appears
earlier in the plan, A would become a constant in subsequent operations.
§Fields
expr: Constant expression for a node in the physical plan.across_partitions: A boolean flag indicating whether the constant expression is the same across partitions. If set totrue, the constant expression has same value for all partitions. If set tofalse, the constant expression may have different values for different partitions.
§Example
let col = lit(5);
// Create a constant expression from a physical expression:
let const_expr = ConstExpr::from(col);Fields§
§expr: Arc<dyn PhysicalExpr>The expression that is known to be constant (e.g. a Column).
across_partitions: AcrossPartitionsIndicates whether the constant have the same value across all partitions.
Implementations§
Source§impl ConstExpr
impl ConstExpr
Sourcepub fn new(
expr: Arc<dyn PhysicalExpr>,
across_partitions: AcrossPartitions,
) -> ConstExpr
pub fn new( expr: Arc<dyn PhysicalExpr>, across_partitions: AcrossPartitions, ) -> ConstExpr
Create a new constant expression from a physical expression, specifying whether the constant expression is the same across partitions.
Note that you can also use ConstExpr::from to create a constant
expression from just a physical expression, with the safe assumption
of heterogenous values across partitions unless the expression is a
literal.
Sourcepub fn format_list(input: &[ConstExpr]) -> impl Display
pub fn format_list(input: &[ConstExpr]) -> impl Display
Returns a Displayable list of ConstExpr.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConstExpr
impl !RefUnwindSafe for ConstExpr
impl Send for ConstExpr
impl Sync for ConstExpr
impl Unpin for ConstExpr
impl !UnwindSafe for ConstExpr
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.