pub trait BuiltInWindowFunctionExpr: Send + Sync + Debug {
// Required methods
fn as_any(&self) -> &dyn Any;
fn field(&self) -> Result<Field>;
fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>> ⓘ;
fn create_evaluator(&self) -> Result<Box<dyn PartitionEvaluator>>;
// Provided methods
fn name(&self) -> &str { ... }
fn evaluate_args(&self, batch: &RecordBatch) -> Result<Vec<ArrayRef>> { ... }
fn reverse_expr(&self) -> Option<Arc<dyn BuiltInWindowFunctionExpr>> { ... }
fn supports_bounded_execution(&self) -> bool { ... }
fn uses_window_frame(&self) -> bool { ... }
}
Expand description
A window expression that is a built-in window function.
Note that unlike aggregation based window functions, built-in window functions normally ignore window frame spec, with the exception of first_value, last_value, and nth_value.
Required Methods§
sourcefn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Returns the aggregate expression as Any
so that it can be
downcast to a specific implementation.
sourcefn 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.
sourcefn create_evaluator(&self) -> Result<Box<dyn PartitionEvaluator>>
fn create_evaluator(&self) -> Result<Box<dyn PartitionEvaluator>>
Create built-in window evaluator with a batch
Provided Methods§
sourcefn name(&self) -> &str
fn name(&self) -> &str
Human readable name such as "MIN(c2)"
or "RANK()"
. The default
implementation returns placeholder text.
sourcefn evaluate_args(&self, batch: &RecordBatch) -> Result<Vec<ArrayRef>>
fn evaluate_args(&self, batch: &RecordBatch) -> Result<Vec<ArrayRef>>
Evaluate window function arguments against the batch and return an array ref. Typically, the resulting vector is a single element vector.
sourcefn reverse_expr(&self) -> Option<Arc<dyn BuiltInWindowFunctionExpr>>
fn reverse_expr(&self) -> Option<Arc<dyn BuiltInWindowFunctionExpr>>
Construct Reverse Expression that produces the same result
on a reversed window. For example lead(10)
–> lag(10)