Skip to content

Convert ApproxPercentileCont and `ApproxPercentileContWithWeight to UDAF #10870

Closed

Description

@goldmedal

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

Activity

  1. goldmedal commented on Jun 11, 2024

    @goldmedal
    ContributorAuthor

    take

  2. goldmedal commented on Jun 11, 2024

    @goldmedal
    ContributorAuthor

    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

  3. jayzhan211 commented on Jun 12, 2024

    @jayzhan211
    Contributor

    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

  4. changed the title [-]Convert `ApproxPercentileCont` to UDAF[/-] [+]Convert `ApproxPercentileCont` and ``ApproxPercentileContWithWeight` to UDAF[/+] on Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions