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§

source

fn as_any(&self) -> &dyn Any

Returns the aggregate expression as Any so that it can be downcast to a specific implementation.

source

fn field(&self) -> Result<Field>

the field of the final result of this aggregation.

source

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 create_evaluator(&self) -> Result<Box<dyn PartitionEvaluator>>

Create built-in window evaluator with a batch

Provided Methods§

source

fn name(&self) -> &str

Human readable name such as "MIN(c2)" or "RANK()". The default implementation returns placeholder text.

source

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.

source

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)

source

fn supports_bounded_execution(&self) -> bool

source

fn uses_window_frame(&self) -> bool

Implementors§