Struct datafusion::physical_expr::ConstExpr
source · 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 valid 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
pub fn with_across_partitions(self, across_partitions: bool) -> ConstExpr
pub fn across_partitions(&self) -> bool
pub fn expr(&self) -> &Arc<dyn PhysicalExpr>
pub fn owned_expr(self) -> Arc<dyn PhysicalExpr>
pub fn map<F>(&self, f: F) -> Option<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,
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<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