Struct datafusion_physical_expr::expressions::LastValue
source · pub struct LastValue { /* private fields */ }
Expand description
TO BE DEPRECATED: Builtin LAST_VALUE physical aggregate expression will be replaced by udf in the future
Implementations§
source§impl LastValuePhysicalExpr
impl LastValuePhysicalExpr
sourcepub fn new(
expr: Arc<dyn PhysicalExpr>,
name: impl Into<String>,
input_data_type: DataType,
ordering_req: Vec<PhysicalSortExpr>,
order_by_data_types: Vec<DataType>
) -> LastValuePhysicalExpr
pub fn new( expr: Arc<dyn PhysicalExpr>, name: impl Into<String>, input_data_type: DataType, ordering_req: Vec<PhysicalSortExpr>, order_by_data_types: Vec<DataType> ) -> LastValuePhysicalExpr
Creates a new LAST_VALUE aggregation function.
pub fn with_ignore_nulls(self, ignore_nulls: bool) -> LastValuePhysicalExpr
sourcepub fn input_data_type(&self) -> &DataType
pub fn input_data_type(&self) -> &DataType
Returns the input data type of the aggregate expression.
sourcepub fn order_by_data_types(&self) -> &Vec<DataType>
pub fn order_by_data_types(&self) -> &Vec<DataType>
Returns the data types of the order-by columns.
sourcepub fn expr(&self) -> &Arc<dyn PhysicalExpr>
pub fn expr(&self) -> &Arc<dyn PhysicalExpr>
Returns the expression associated with the aggregate function.
sourcepub fn ordering_req(&self) -> &Vec<PhysicalSortExpr>
pub fn ordering_req(&self) -> &Vec<PhysicalSortExpr>
Returns the lexical ordering requirements of the aggregate expression.
pub fn with_requirement_satisfied( self, requirement_satisfied: bool ) -> LastValuePhysicalExpr
pub fn convert_to_first(self) -> FirstValuePhysicalExpr
Trait Implementations§
source§impl AggregateExpr for LastValuePhysicalExpr
impl AggregateExpr for LastValuePhysicalExpr
source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Return a reference to Any that can be used for downcasting
source§fn field(&self) -> Result<Field, DataFusionError>
fn field(&self) -> Result<Field, DataFusionError>
the field of the final result of this aggregation.
source§fn create_accumulator(&self) -> Result<Box<dyn Accumulator>, DataFusionError>
fn create_accumulator(&self) -> Result<Box<dyn Accumulator>, DataFusionError>
the accumulator used to accumulate values from the expressions.
the accumulator expects the same number of arguments as
expressions
and must
return states with the same description as state_fields
source§fn state_fields(&self) -> Result<Vec<Field>, DataFusionError>
fn state_fields(&self) -> Result<Vec<Field>, DataFusionError>
the fields that encapsulate the Accumulator’s state
the number of fields here equals the number of states that the accumulator contains
source§fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>
fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>
expressions that are passed to the Accumulator.
Single-column aggregations such as
sum
return a single value, others (e.g. cov
) return many.source§fn order_bys(&self) -> Option<&[PhysicalSortExpr]>
fn order_bys(&self) -> Option<&[PhysicalSortExpr]>
Order by requirements for the aggregate function
By default it is
None
(there is no requirement)
Order-sensitive aggregators, such as FIRST_VALUE(x ORDER BY y)
should implement thissource§fn name(&self) -> &str
fn name(&self) -> &str
Human readable name such as
"MIN(c2)"
. The default
implementation returns placeholder text.source§fn reverse_expr(&self) -> Option<Arc<dyn AggregateExpr>>
fn reverse_expr(&self) -> Option<Arc<dyn AggregateExpr>>
Construct an expression that calculates the aggregate in reverse.
Typically the “reverse” expression is itself (e.g. SUM, COUNT).
For aggregates that do not support calculation in reverse,
returns None (which is the default value).
source§fn create_sliding_accumulator(
&self
) -> Result<Box<dyn Accumulator>, DataFusionError>
fn create_sliding_accumulator( &self ) -> Result<Box<dyn Accumulator>, DataFusionError>
Creates accumulator implementation that supports retract
source§fn groups_accumulator_supported(&self) -> bool
fn groups_accumulator_supported(&self) -> bool
If the aggregate expression has a specialized
GroupsAccumulator
implementation. If this returns true,
[Self::create_groups_accumulator
] will be called.source§fn create_groups_accumulator(
&self
) -> Result<Box<dyn GroupsAccumulator>, DataFusionError>
fn create_groups_accumulator( &self ) -> Result<Box<dyn GroupsAccumulator>, DataFusionError>
Return a specialized
GroupsAccumulator
that manages state
for all groups. Read moresource§impl Clone for LastValuePhysicalExpr
impl Clone for LastValuePhysicalExpr
source§fn clone(&self) -> LastValuePhysicalExpr
fn clone(&self) -> LastValuePhysicalExpr
Returns a copy 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 LastValuePhysicalExpr
impl Debug for LastValuePhysicalExpr
Auto Trait Implementations§
impl Freeze for LastValuePhysicalExpr
impl !RefUnwindSafe for LastValuePhysicalExpr
impl Send for LastValuePhysicalExpr
impl Sync for LastValuePhysicalExpr
impl Unpin for LastValuePhysicalExpr
impl !UnwindSafe for LastValuePhysicalExpr
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> 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