jorgecarleitao commented on a change in pull request #8654:
URL: https://github.com/apache/arrow/pull/8654#discussion_r523749603



##########
File path: rust/datafusion/src/physical_plan/hash_aggregate.rs
##########
@@ -882,25 +867,12 @@ mod tests {
         assert_eq!(batch.num_columns(), 2);
         assert_eq!(batch.num_rows(), 3);
 
-        let a = batch
-            .column(0)
-            .as_any()
-            .downcast_ref::<UInt32Array>()
-            .unwrap();
-        let b = batch
-            .column(1)
-            .as_any()
-            .downcast_ref::<Float64Array>()
-            .unwrap();
-
-        assert_eq!(*a, UInt32Array::from(vec![2, 3, 4]));
+        let mut rows = crate::test::format_batch(&batch);
+        rows.sort();
+
         assert_eq!(
-            *b,
-            Float64Array::from(vec![
-                1.0,
-                (2.0 + 3.0 + 2.0) / 3.0,
-                (3.0 + 4.0 + 4.0) / 3.0
-            ])
+            rows,

Review comment:
       Could we keep the expressions? `(2.0 + 3.0 + 2.0) / 3.0` is much more 
informative than `2.3333333333333335`, imo.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to