alamb commented on issue #10423:
URL: https://github.com/apache/datafusion/issues/10423#issuecomment-2102415148

   It is a good observation that  `ScalarUDFImpl` and `AggregateUDFImpl` don't 
share a common base trait  and thus adding functionality that affects both 
requires duplication of code
   
   > I would need to introduce a more general trait for both function
   > Another alternative is having a duplicate function for scalar and 
aggregate for a related function
   
   I agree with your analysis of the tradeoffs: a common base trait would 
result in less duplication in DataFusion
   
   However, I personally prefer duplicating `coerce_arguments_for_signature`  
in each trait rather than introducing a common base trait because:
   1. It is backwards compatible (not an API change for the existing library of 
functions)
   2. Makes it slightly easier to implement ScalarUDF and AggregateUDF 
(especially when new to rust) -- rather than two `impl`s for your function, you 
only need one
   
   


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to