Struct datafusion::physical_plan::expressions::NthValue
source · pub struct NthValue { /* private fields */ }
Expand description
nth_value expression
Implementations§
source§impl NthValue
impl NthValue
sourcepub fn first(
name: impl Into<String>,
expr: Arc<dyn PhysicalExpr + 'static>,
data_type: DataType
) -> NthValue
pub fn first( name: impl Into<String>, expr: Arc<dyn PhysicalExpr + 'static>, data_type: DataType ) -> NthValue
Create a new FIRST_VALUE window aggregate function
sourcepub fn last(
name: impl Into<String>,
expr: Arc<dyn PhysicalExpr + 'static>,
data_type: DataType
) -> NthValue
pub fn last( name: impl Into<String>, expr: Arc<dyn PhysicalExpr + 'static>, data_type: DataType ) -> NthValue
Create a new LAST_VALUE window aggregate function
sourcepub fn nth(
name: impl Into<String>,
expr: Arc<dyn PhysicalExpr + 'static>,
data_type: DataType,
n: u32
) -> Result<NthValue, DataFusionError>
pub fn nth( name: impl Into<String>, expr: Arc<dyn PhysicalExpr + 'static>, data_type: DataType, n: u32 ) -> Result<NthValue, DataFusionError>
Create a new NTH_VALUE window aggregate function
Trait Implementations§
source§impl BuiltInWindowFunctionExpr for NthValue
impl BuiltInWindowFunctionExpr for NthValue
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 expressions(&self) -> Vec<Arc<dyn PhysicalExpr + 'static>, Global> ⓘ
fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr + 'static>, Global> ⓘ
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 name(&self) -> &str
fn name(&self) -> &str
Human readable name such as
"MIN(c2)"
or "RANK()"
. The default
implementation returns placeholder text.source§fn create_evaluator(
&self
) -> Result<Box<dyn PartitionEvaluator + 'static, Global>, DataFusionError>
fn create_evaluator( &self ) -> Result<Box<dyn PartitionEvaluator + 'static, Global>, DataFusionError>
Create built-in window evaluator with a batch
fn supports_bounded_execution(&self) -> bool
fn uses_window_frame(&self) -> bool
source§fn reverse_expr(&self) -> Option<Arc<dyn BuiltInWindowFunctionExpr + 'static>>
fn reverse_expr(&self) -> Option<Arc<dyn BuiltInWindowFunctionExpr + 'static>>
Construct Reverse Expression that produces the same result
on a reversed window. For example
lead(10)
–> lag(10)
source§fn evaluate_args(
&self,
batch: &RecordBatch
) -> Result<Vec<Arc<dyn Array + 'static>, Global>, DataFusionError>
fn evaluate_args( &self, batch: &RecordBatch ) -> Result<Vec<Arc<dyn Array + 'static>, Global>, DataFusionError>
Evaluate window function arguments against the batch and return
an array ref. Typically, the resulting vector is a single element vector.