liukun4515 opened a new issue #1418:
URL: https://github.com/apache/arrow-datafusion/issues/1418


   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   In the #122  and #1356, I add new datatype(decimal) and propose a more clear 
coercion rule for expr system.
   When I add decimal to the SUM and AVG function, i meet some problem.
   It's about the returned data type.
   
   For example:
   
https://github.com/apache/arrow-datafusion/blob/415c5e124af18a05500514f78604366d860dcf5a/datafusion/src/physical_plan/expressions/sum.rs#L49
 for floating-point datatype, the 
[pg](https://www.postgresql.org/docs/8.2/functions-aggregate.html) use the 
double-precision(double/float64) as the returned data type, but the datafusion 
is different.
   
   There may be other different rules in 
[spark](https://spark.apache.org/docs/3.2.0/sql-ref-ansi-compliance.html#type-coercion)
   
   Which rule should we follow? For example sum and avg?
   @alamb @houqp 
   
   **Describe the solution you'd like**
   A clear and concise description of what you want to happen.
   
   **Describe alternatives you've considered**
   A clear and concise description of any alternative solutions or features 
you've considered.
   
   **Additional context**
   Add any other context or screenshots about the feature request here.
   


-- 
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...@arrow.apache.org

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


Reply via email to