use crate::{PhysicalExpr, PhysicalSortExpr};
use arrow::array::ArrayRef;
use arrow::datatypes::{FieldRef, SchemaRef};
use arrow::record_batch::RecordBatch;
use datafusion_common::Result;
use datafusion_expr::{LimitEffect, PartitionEvaluator};
use datafusion_physical_expr_common::utils::evaluate_expressions_to_arrays;
use std::any::Any;
use std::sync::Arc;
pub trait StandardWindowFunctionExpr: Send + Sync + std::fmt::Debug {
fn as_any(&self) -> &dyn Any;
fn field(&self) -> Result<FieldRef>;
fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>;
fn name(&self) -> &str {
"StandardWindowFunctionExpr: default name"
}
fn evaluate_args(&self, batch: &RecordBatch) -> Result<Vec<ArrayRef>> {
evaluate_expressions_to_arrays(&self.expressions(), batch)
}
fn create_evaluator(&self) -> Result<Box<dyn PartitionEvaluator>>;
fn reverse_expr(&self) -> Option<Arc<dyn StandardWindowFunctionExpr>> {
None
}
fn get_result_ordering(&self, _schema: &SchemaRef) -> Option<PhysicalSortExpr> {
None
}
fn limit_effect(&self) -> LimitEffect;
}