pub struct ProjectionExpr {
pub expr: Arc<dyn PhysicalExpr>,
pub alias: String,
}Expand description
An expression used by projection operations.
The expression is evaluated and the result is stored in a column
with the name specified by alias.
For example, the SQL expression a + b AS sum_ab would be represented
as a ProjectionExpr where expr is the expression a + b
and alias is the string sum_ab.
See ProjectionExprs for a collection of projection expressions.
Fields§
§expr: Arc<dyn PhysicalExpr>The expression that will be evaluated.
alias: StringThe name of the output column for use an output schema.
Implementations§
Source§impl ProjectionExpr
impl ProjectionExpr
Sourcepub fn new(
expr: Arc<dyn PhysicalExpr>,
alias: impl Into<String>,
) -> ProjectionExpr
pub fn new( expr: Arc<dyn PhysicalExpr>, alias: impl Into<String>, ) -> ProjectionExpr
Create a new projection expression
Sourcepub fn new_from_expression(
expr: Arc<dyn PhysicalExpr>,
schema: &Schema,
) -> Result<ProjectionExpr, DataFusionError>
pub fn new_from_expression( expr: Arc<dyn PhysicalExpr>, schema: &Schema, ) -> Result<ProjectionExpr, DataFusionError>
Create a new projection expression from an expression and a schema using the expression’s output field name as alias.
Trait Implementations§
Source§impl AsPhysicalExprRef for ProjectionExpr
Allows a ProjectionExpr to be treated as a reference to its
Arc<dyn PhysicalExpr>.
impl AsPhysicalExprRef for ProjectionExpr
Allows a ProjectionExpr to be treated as a reference to its
Arc<dyn PhysicalExpr>.
Source§fn as_physical_expr_ref(&self) -> &Arc<dyn PhysicalExpr> ⓘ
fn as_physical_expr_ref(&self) -> &Arc<dyn PhysicalExpr> ⓘ
Source§impl AsRef<Arc<dyn PhysicalExpr>> for ProjectionExpr
Enables ProjectionExpr to be treated as a reference to its wrapped
Arc<dyn PhysicalExpr> using AsRef::as_ref.
impl AsRef<Arc<dyn PhysicalExpr>> for ProjectionExpr
Enables ProjectionExpr to be treated as a reference to its wrapped
Arc<dyn PhysicalExpr> using AsRef::as_ref.
Source§impl Clone for ProjectionExpr
impl Clone for ProjectionExpr
Source§fn clone(&self) -> ProjectionExpr
fn clone(&self) -> ProjectionExpr
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 ProjectionExpr
impl Debug for ProjectionExpr
Source§impl Display for ProjectionExpr
impl Display for ProjectionExpr
impl Eq for ProjectionExpr
Source§impl From<&(Arc<dyn PhysicalExpr>, String)> for ProjectionExpr
impl From<&(Arc<dyn PhysicalExpr>, String)> for ProjectionExpr
Source§fn from(value: &(Arc<dyn PhysicalExpr>, String)) -> ProjectionExpr
fn from(value: &(Arc<dyn PhysicalExpr>, String)) -> ProjectionExpr
Source§impl From<(Arc<dyn PhysicalExpr>, String)> for ProjectionExpr
impl From<(Arc<dyn PhysicalExpr>, String)> for ProjectionExpr
Source§fn from(value: (Arc<dyn PhysicalExpr>, String)) -> ProjectionExpr
fn from(value: (Arc<dyn PhysicalExpr>, String)) -> ProjectionExpr
Source§impl FromIterator<ProjectionExpr> for ProjectionExprs
impl FromIterator<ProjectionExpr> for ProjectionExprs
Source§fn from_iter<T>(exprs: T) -> ProjectionExprswhere
T: IntoIterator<Item = ProjectionExpr>,
fn from_iter<T>(exprs: T) -> ProjectionExprswhere
T: IntoIterator<Item = ProjectionExpr>,
Auto Trait Implementations§
impl !RefUnwindSafe for ProjectionExpr
impl !UnwindSafe for ProjectionExpr
impl Freeze for ProjectionExpr
impl Send for ProjectionExpr
impl Sync for ProjectionExpr
impl Unpin for ProjectionExpr
impl UnsafeUnpin for ProjectionExpr
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<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