pub struct ProjectionExpr {
pub expr: Arc<dyn PhysicalExpr>,
pub alias: String,
}Expand description
A projection expression as 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.
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: String) -> ProjectionExpr
pub fn new(expr: Arc<dyn PhysicalExpr>, alias: 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 Clone for ProjectionExpr
impl Clone for ProjectionExpr
Source§fn clone(&self) -> ProjectionExpr
fn clone(&self) -> ProjectionExpr
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProjectionExpr
impl Debug for ProjectionExpr
Source§impl Display for ProjectionExpr
impl Display 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
Converts to this type from the input type.
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
Converts to this type from the input type.
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>,
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for ProjectionExpr
impl !RefUnwindSafe for ProjectionExpr
impl Send for ProjectionExpr
impl Sync for ProjectionExpr
impl Unpin for ProjectionExpr
impl !UnwindSafe 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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