kumarUjjawal commented on code in PR #19463:
URL: https://github.com/apache/datafusion/pull/19463#discussion_r2642562896
##########
datafusion/functions-aggregate/src/correlation.rs:
##########
@@ -85,8 +86,11 @@ impl Correlation {
/// Create a new CORR aggregate function
pub fn new() -> Self {
Self {
- signature: Signature::exact(
- vec![DataType::Float64, DataType::Float64],
+ signature: Signature::coercible(
+ vec![
+ Coercion::new_exact(TypeSignatureClass::Numeric),
+ Coercion::new_exact(TypeSignatureClass::Numeric),
+ ],
Review Comment:
I was thinking that the current NUMERICS list explicitly excludes Decimals
(see
[aggregates.rs](https://github.com/apache/datafusion/blob/main/datafusion/expr-common/src/type_coercion/aggregates.rs#L25-L34)).
These functions already cast to Float64 internally
(https://github.com/apache/datafusion/blob/33ac70dd6d634da040cc34abd414425b176a2b99/datafusion/functions-aggregate/src/variance.rs#L333)
and return Float64, so Decimals can be handled the same way integers are.
--
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]