pub struct BinaryExpr { /* private fields */ }Expand description
Binary expression
Implementations§
Source§impl BinaryExpr
impl BinaryExpr
Sourcepub fn new(
left: Arc<dyn PhysicalExpr>,
op: Operator,
right: Arc<dyn PhysicalExpr>,
) -> Self
pub fn new( left: Arc<dyn PhysicalExpr>, op: Operator, right: Arc<dyn PhysicalExpr>, ) -> Self
Create new binary expression
Sourcepub fn with_fail_on_overflow(self, fail_on_overflow: bool) -> Self
pub fn with_fail_on_overflow(self, fail_on_overflow: bool) -> Self
Create new binary expression with explicit fail_on_overflow value
Sourcepub fn left(&self) -> &Arc<dyn PhysicalExpr> ⓘ
pub fn left(&self) -> &Arc<dyn PhysicalExpr> ⓘ
Get the left side of the binary expression
Sourcepub fn right(&self) -> &Arc<dyn PhysicalExpr> ⓘ
pub fn right(&self) -> &Arc<dyn PhysicalExpr> ⓘ
Get the right side of the binary expression
Source§impl BinaryExpr
impl BinaryExpr
Sourcepub fn try_from_proto(
node: &PhysicalExprNode,
ctx: &PhysicalExprDecodeCtx<'_>,
) -> Result<Arc<dyn PhysicalExpr>>
Available on crate feature proto only.
pub fn try_from_proto( node: &PhysicalExprNode, ctx: &PhysicalExprDecodeCtx<'_>, ) -> Result<Arc<dyn PhysicalExpr>>
proto only.Reconstruct a BinaryExpr (or a left-deep tree of them when the proto
uses the linearized operands form) from its protobuf representation.
Takes the whole PhysicalExprNode — the exact inverse of what
PhysicalExpr::try_to_proto produces — so every expression’s
try_from_proto shares one signature. The operator string is parsed
via the canonical Operator::from_proto_name mapping, so no op
argument needs to be threaded in by the caller.
Trait Implementations§
Source§impl Clone for BinaryExpr
impl Clone for BinaryExpr
Source§fn clone(&self) -> BinaryExpr
fn clone(&self) -> BinaryExpr
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BinaryExpr
impl Debug for BinaryExpr
Source§impl Display for BinaryExpr
impl Display for BinaryExpr
impl Eq for BinaryExpr
Source§impl Hash for BinaryExpr
impl Hash for BinaryExpr
Source§impl PartialEq for BinaryExpr
impl PartialEq for BinaryExpr
Source§impl PhysicalExpr for BinaryExpr
impl PhysicalExpr for BinaryExpr
Source§fn get_properties(&self, children: &[ExprProperties]) -> Result<ExprProperties>
fn get_properties(&self, children: &[ExprProperties]) -> Result<ExprProperties>
For each operator, BinaryExpr has distinct rules.
TODO: There may be rules specific to some data types and expression ranges.
Source§fn data_type(&self, input_schema: &Schema) -> Result<DataType>
fn data_type(&self, input_schema: &Schema) -> Result<DataType>
Source§fn nullable(&self, input_schema: &Schema) -> Result<bool>
fn nullable(&self, input_schema: &Schema) -> Result<bool>
Source§fn evaluate(&self, batch: &RecordBatch) -> Result<ColumnarValue>
fn evaluate(&self, batch: &RecordBatch) -> Result<ColumnarValue>
Source§fn children(&self) -> Vec<&Arc<dyn PhysicalExpr>>
fn children(&self) -> Vec<&Arc<dyn PhysicalExpr>>
Source§fn with_new_children(
self: Arc<Self>,
children: Vec<Arc<dyn PhysicalExpr>>,
) -> Result<Arc<dyn PhysicalExpr>>
fn with_new_children( self: Arc<Self>, children: Vec<Arc<dyn PhysicalExpr>>, ) -> Result<Arc<dyn PhysicalExpr>>
Source§fn evaluate_bounds(&self, children: &[&Interval]) -> Result<Interval>
fn evaluate_bounds(&self, children: &[&Interval]) -> Result<Interval>
Source§fn propagate_constraints(
&self,
interval: &Interval,
children: &[&Interval],
) -> Result<Option<Vec<Interval>>>
fn propagate_constraints( &self, interval: &Interval, children: &[&Interval], ) -> Result<Option<Vec<Interval>>>
Source§fn evaluate_statistics(
&self,
children: &[&Distribution],
) -> Result<Distribution>
fn evaluate_statistics( &self, children: &[&Distribution], ) -> Result<Distribution>
Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071
Source§fn fmt_sql(&self, f: &mut Formatter<'_>) -> Result
fn fmt_sql(&self, f: &mut Formatter<'_>) -> Result
PhysicalExpr in nice human readable “SQL” format Read moreSource§fn try_to_proto(
&self,
ctx: &PhysicalExprEncodeCtx<'_>,
) -> Result<Option<PhysicalExprNode>>
fn try_to_proto( &self, ctx: &PhysicalExprEncodeCtx<'_>, ) -> Result<Option<PhysicalExprNode>>
proto only.PhysicalExprNode proto message. Read moreSource§fn return_field(
&self,
input_schema: &Schema,
) -> Result<Arc<Field>, DataFusionError>
fn return_field( &self, input_schema: &Schema, ) -> Result<Arc<Field>, DataFusionError>
Source§fn evaluate_selection(
&self,
batch: &RecordBatch,
selection: &BooleanArray,
) -> Result<ColumnarValue, DataFusionError>
fn evaluate_selection( &self, batch: &RecordBatch, selection: &BooleanArray, ) -> Result<ColumnarValue, DataFusionError>
Source§fn propagate_statistics(
&self,
parent: &Distribution,
children: &[&Distribution],
) -> Result<Option<Vec<Distribution>>, DataFusionError>
fn propagate_statistics( &self, parent: &Distribution, children: &[&Distribution], ) -> Result<Option<Vec<Distribution>>, DataFusionError>
Part of the unused Statistics V2 framework; see https://github.com/apache/datafusion/pull/22071
Source§fn snapshot(&self) -> Result<Option<Arc<dyn PhysicalExpr>>, DataFusionError>
fn snapshot(&self) -> Result<Option<Arc<dyn PhysicalExpr>>, DataFusionError>
PhysicalExpr, if it is dynamic. Read moreSource§fn snapshot_generation(&self) -> u64
fn snapshot_generation(&self) -> u64
PhysicalExpr for snapshotting purposes.
The generation is an arbitrary u64 that can be used to track changes
in the state of the PhysicalExpr over time without having to do an exhaustive comparison.
This is useful to avoid unnecessary computation or serialization if there are no changes to the expression.
In particular, dynamic expressions that may change over time; this allows cheap checks for changes.
Static expressions that do not change over time should return 0, as does the default implementation.
You should not call this method directly as it does not handle recursion.
Instead use snapshot_generation to handle recursion and capture the
full state of the PhysicalExpr.Source§fn is_volatile_node(&self) -> bool
fn is_volatile_node(&self) -> bool
Source§fn placement(&self) -> ExpressionPlacement
fn placement(&self) -> ExpressionPlacement
Source§fn expression_id(&self) -> Option<u64>
fn expression_id(&self) -> Option<u64>
PhysicalExpr, if it
has one. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for BinaryExpr
impl !UnwindSafe for BinaryExpr
impl Freeze for BinaryExpr
impl Send for BinaryExpr
impl Sync for BinaryExpr
impl Unpin for BinaryExpr
impl UnsafeUnpin for BinaryExpr
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<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> 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