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


##########
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:
   🤔  this is very close to 
https://docs.rs/arrow/34.0.0/arrow/datatypes/enum.DataType.html#method.is_numeric
 except that is_numeric also includes Decimals.
   
   



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