pub fn to_datafusion_expr(self, input: Expr) -> Result<Expr> {
        use datafusion::logical_plan::{avg, count, max, min, sum};
        match self {
            Self::Sum => Ok(sum(input)),
            Self::Count => Ok(count(input)),
            Self::Min => Ok(min(input)),
            Self::Max => Ok(max(input)),
            Self::First => AggregateNotSupported { agg: "First" }.fail(),
            Self::Last => AggregateNotSupported { agg: "Last" }.fail(),
            Self::Mean => Ok(avg(input)),
            Self::None => AggregateNotSupported { agg: "None" }.fail(),
        }
    }
/// Create the appropriate DataFusion expression for this aggregate
Create the appropriate DataFusion expression for this aggregate
Create the appropriate DataFusion expression for this aggregate
pub fn to_datafusion_expr(self, input: Expr) -> Result<Expr> {
        use datafusion::logical_plan::{avg, count, max, min, sum};
        match self {
            Self::Sum => Ok(sum(input)),
            Self::Count => Ok(count(input)),
            Self::Min => Ok(min(input)),
            Self::Max => Ok(max(input)),
            Self::First => AggregateNotSupported { agg: "First" }.fail(),
            Self::Last => AggregateNotSupported { agg: "Last" }.fail(),
            Self::Mean => Ok(avg(input)),
            Self::None => AggregateNotSupported { agg: "None" }.fail(),
        }
    }
pub fn to_datafusion_expr ( self , input : Expr ) -> Result < Expr > { use datafusion :: logical_plan :: { avg , count , max , min , sum } ; match self { Self :: Sum => Ok ( sum ( input ) ) , Self :: Count => Ok ( count ( input ) ) , Self :: Min => Ok ( min ( input ) ) , Self :: Max => Ok ( max ( input ) ) , Self :: First => AggregateNotSupported { agg : " " } . fail ( ) , Self :: Last => AggregateNotSupported { agg : " " } . fail ( ) , Self :: Mean => Ok ( avg ( input ) ) , Self :: None => AggregateNotSupported { agg : " " } . fail ( ) , } }
Create the appropriate DataFusion expression for this aggregate
Create the appropriate DataFusion expression for this aggregate
self
input
Expr
self
input
Expr