jayzhan211 opened a new issue, #10703:
URL: https://github.com/apache/datafusion/issues/10703

   ### 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) in 
`replace_distinct_aggregate`.
   
   Discussion from 
https://github.com/apache/datafusion/pull/10648#discussion_r1617221359
   
   ### 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_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to