adriangb commented on code in PR #25966:
URL: https://github.com/apache/datafusion/pull/25966#discussion_r4299222153
##########
datafusion/functions-aggregate/src/sum.rs:
##########
@@ -397,6 +397,9 @@ impl AggregateUDFImpl for Sum {
if lit_type == DataType::Null {
return Ok(None);
}
+ if !(lit_type.is_integer() || lit_type.is_floating()) {
Review Comment:
Nit: a short comment here helps the next reader know why decimals and
intervals are skipped.
```suggestion
// `CAST(COUNT(arg) AS <lit type>)` is not valid for intervals, and
for
// decimals it can overflow or change the SUM result type.
// See https://github.com/apache/datafusion/issues/25943
if !(lit_type.is_integer() || lit_type.is_floating()) {
```
--
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]