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


##########
datafusion/core/tests/sqllogictests/test_files/aggregate.slt:
##########
@@ -1524,3 +1524,17 @@ NULL
 
 query error DataFusion error: Execution error: aggregate function needs at 
least one non-null element
 select approx_median(a) from (select 1 as a where 1=0);
+
+
+# aggregate_decimal_sum
+query RT
+select sum(c1), arrow_typeof(sum(c1)) from d_table;
+----
+100 Decimal128(20, 3)
+
+
+# aggregate_decimal_avg
+query RT
+select avg(c1), arrow_typeof(avg(c1)) from d_table

Review Comment:
   I am not sure to be honest. Maybe @liukun4515  remembers why the type of 
`AVG` is different.  This PR just ports the previous check (that also verified 
the type) from
   
    
https://github.com/apache/arrow-datafusion/pull/5739/files#diff-9766ab13aa508a77a8a7fb3e31ba2394e2308b475022ec8f38c3bc6a21d09f58L111
   ```rust
       assert_eq!(
           &DataType::Decimal128(14, 7),
           result[0].schema().field(0).data_type()
       );
   ```



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