You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Convert ApproxPercentileCont and `ApproxPercentileContWithWeight to UDAF #10870
However, AggregateFunctionExpr only takes args that are PhysicalExpr. I think AccumulatorArgs is a logical plan struct that should be placed in datafusion-expr. It can't access PhysicalExpr.
Curiously, is it possible to convert PhysicalExpr back to Expr?
If not, I plan to pass the original Expr to AggregateFunctionExpr (just like sort_exprs: Vec<Expr>), then pass it to AccumulatorArgs.
changed the title [-]Convert `ApproxPercentileCont` to UDAF[/-][+]Convert `ApproxPercentileCont` and ``ApproxPercentileContWithWeight` to UDAF[/+]on Jun 14, 2024
Activity
goldmedal commentedon Jun 11, 2024
take
goldmedal commentedon Jun 11, 2024
Hi @jayzhan211,
Continuing from our previous discussion in #10838 (comment), I believe there are still some issues.
We create
AccumulatorArgsinhttps://github.com/apache/datafusion/blob/main/datafusion/physical-expr-common/src/aggregate/mod.rs#L287.
However,
AggregateFunctionExpronly takesargsthat arePhysicalExpr. I thinkAccumulatorArgsis a logical plan struct that should be placed indatafusion-expr. It can't accessPhysicalExpr.Curiously, is it possible to convert
PhysicalExprback toExpr?If not, I plan to pass the original
ExprtoAggregateFunctionExpr(just likesort_exprs: Vec<Expr>), then pass it toAccumulatorArgs.Does this make sense? What do you think?
Thanks
jayzhan211 commentedon Jun 12, 2024
I think it is possible, but in this case, we can just pass the
Expr: Vec<Expr>toAggregateFunctionExprlikeSortExpris[-]Convert `ApproxPercentileCont` to UDAF[/-][+]Convert `ApproxPercentileCont` and ``ApproxPercentileContWithWeight` to UDAF[/+]