comphead commented on code in PR #5537:
URL: https://github.com/apache/arrow-datafusion/pull/5537#discussion_r1131816757


##########
datafusion/expr/src/type_coercion/aggregates.rs:
##########
@@ -314,77 +314,45 @@ pub fn sum_return_type(arg_type: &DataType) -> 
Result<DataType> {
 
 /// function return type of variance
 pub fn variance_return_type(arg_type: &DataType) -> Result<DataType> {
-    match arg_type {
-        DataType::Int8
-        | DataType::Int16
-        | DataType::Int32
-        | DataType::Int64
-        | DataType::UInt8
-        | DataType::UInt16
-        | DataType::UInt32
-        | DataType::UInt64
-        | DataType::Float32
-        | DataType::Float64 => Ok(DataType::Float64),
-        other => Err(DataFusionError::Plan(format!(
-            "VAR does not support {other:?}"
-        ))),
+    if NUMERICS.contains(arg_type) {

Review Comment:
   sort of
   ```
   fn is_numeric(arg_type: &DataType) -> bool {
       return arg_type.is_numeric() && match arg_type {
           Decimal128(_, _) | Decimal() => false
           _ => true
       } 
   }
   ```



-- 
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]

Reply via email to