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

Decouple builtin aggregate function first_value from optimize rule replace_distinct_aggregate #10703

Closed
jayzhan211 opened this issue May 29, 2024 · 0 comments · Fixed by #10714
Assignees
Labels
enhancement New feature or request

Comments

@jayzhan211
Copy link
Contributor

jayzhan211 commented May 29, 2024

Is your feature request related to a problem or challenge?

If we move the built-in function out of the optimizer, it is more easy to extend/adapt the optimizer rule to other UDAFs. For example, change the first_value (datafusion builtin) to first_value (UDAF) or my_function (UDAF) in replace_distinct_aggregate.

Discussion from #10648 (comment)

Describe the solution you'd like

  1. Move the replace_distinct_aggregate to functions-aggregate as part of the builtin optimize rule, and register the rule to optimizer rules
  2. Enable FunctionRegistry in the optimizer rule, we always get the function with the name "first_value" here, if they have first_value UDAF, they can take advantage of this rule by replacing the first_value to their version.

Describe alternatives you've considered

No response

Additional context

No response

@jayzhan211 jayzhan211 added the enhancement New feature or request label May 29, 2024
@jayzhan211 jayzhan211 changed the title Decouple builtin aggregate function from optimizer Decouple builtin aggregate function first_value from optimize rule replace_distinct_aggregate May 29, 2024
@jayzhan211 jayzhan211 self-assigned this May 29, 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.

1 participant