Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert ApproxPercentileCont and `ApproxPercentileContWithWeight to UDAF #10870

Closed
goldmedal opened this issue Jun 11, 2024 · 3 comments · Fixed by #10917
Closed

Convert ApproxPercentileCont and `ApproxPercentileContWithWeight to UDAF #10870

goldmedal opened this issue Jun 11, 2024 · 3 comments · Fixed by #10917
Assignees
Labels
enhancement New feature or request

Comments

@goldmedal
Copy link
Contributor

Is your feature request related to a problem or challenge?

Similar to #10838 and others #8708
However, there're some challenge to convert ApproxPercentileCont.
I discussed with @jayzhan211 in #10838 (comment)

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

@goldmedal goldmedal added the enhancement New feature or request label Jun 11, 2024
@goldmedal
Copy link
Contributor Author

take

@goldmedal
Copy link
Contributor Author

Hi @jayzhan211,

Continuing from our previous discussion in #10838 (comment), I believe there are still some issues.

We create AccumulatorArgs in
https://github.com/apache/datafusion/blob/main/datafusion/physical-expr-common/src/aggregate/mod.rs#L287.

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.

Does this make sense? What do you think?
Thanks

@jayzhan211
Copy link
Contributor

jayzhan211 commented Jun 12, 2024

is it possible to convert PhysicalExpr back to Expr?

I think it is possible, but in this case, we can just pass the Expr: Vec<Expr> to AggregateFunctionExpr like SortExpr is

@goldmedal goldmedal changed the title Convert ApproxPercentileCont to UDAF Convert ApproxPercentileCont and `ApproxPercentileContWithWeight to UDAF Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants