pub struct ConstExpr { /* private fields */ }
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 predicate like A = 5
applied earlier in the plan A
would
be known constant
§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 ref
let const_expr = ConstExpr::from(&col);
// create a constant expression from a physical expression
let const_expr = ConstExpr::from(col);
Implementations§
Source§impl ConstExpr
impl ConstExpr
Sourcepub fn new(expr: Arc<dyn PhysicalExpr>) -> ConstExpr
pub fn new(expr: Arc<dyn PhysicalExpr>) -> ConstExpr
Create a new constant expression from a physical expression.
Note you can also use ConstExpr::from
to create a constant expression
from a reference as well
Sourcepub fn with_across_partitions(self, across_partitions: bool) -> ConstExpr
pub fn with_across_partitions(self, across_partitions: bool) -> ConstExpr
Set the across_partitions
flag
See struct docs for more details
Sourcepub fn across_partitions(&self) -> bool
pub fn across_partitions(&self) -> bool
Is the expression the same across all partitions?
See struct docs for more details
pub fn expr(&self) -> &Arc<dyn PhysicalExpr>
pub fn owned_expr(self) -> Arc<dyn PhysicalExpr>
pub fn map<F>(&self, f: F) -> Option<ConstExpr>
Sourcepub fn eq_expr(&self, other: impl AsRef<dyn PhysicalExpr>) -> bool
pub fn eq_expr(&self, other: impl AsRef<dyn PhysicalExpr>) -> bool
Returns true if this constant expression is equal to the given expression
Sourcepub fn format_list(input: &[ConstExpr]) -> impl Display
pub fn format_list(input: &[ConstExpr]) -> impl Display
Returns a Display
able list of ConstExpr
.
Trait Implementations§
Source§impl Display for ConstExpr
Display implementation for ConstExpr
impl Display for ConstExpr
Display implementation for ConstExpr
Example c
or c(across_partitions)
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,
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