rluvaton commented on code in PR #25900:
URL: https://github.com/apache/datafusion/pull/25900#discussion_r4145847264


##########
datafusion/physical-plan/src/aggregates/mod.rs:
##########
@@ -5433,30 +5609,22 @@ mod tests {
             num_input_batches
         );
 
-        // The table is flushed after every input batch, so each of the three
-        // groups is emitted once per input batch instead of being merged into 
a
-        // single row. Each flush is sliced into batches of 2 and 1 rows.
-        assert_eq!(output.len(), 2 * num_input_batches);
-        assert_snapshot!(batches_to_string(&output), @r"
-        +---+-------------+
-        | a | SUM(b)[sum] |
-        +---+-------------+
-        | 1 | 50.0        |
-        | 2 | 20.0        |
-        | 3 | 30.0        |
-        | 1 | 50.0        |
-        | 2 | 20.0        |
-        | 3 | 30.0        |
-        | 1 | 50.0        |
-        | 2 | 20.0        |
-        | 3 | 30.0        |
-        +---+-------------+
-        ");
+        // The table is flushed after every input batch, so every group is 
emitted
+        // once per input batch instead of being merged into a single row. Each
+        // flush of 256 groups is sliced into batches of 100, 100 and 56 rows.
+        let batch_rows: Vec<_> = 
output.iter().map(RecordBatch::num_rows).collect();
+        assert_eq!(batch_rows, [100, 100, 56].repeat(num_input_batches));
+        let output = concat_batches(&output[0].schema(), &output)?;
+        let a = output.column(0).as_primitive::<UInt32Type>();
+        let sums = output.column(1).as_primitive::<Float64Type>();
+        for row in 0..output.num_rows() {
+            assert_eq!(sums.value(row), f64::from(a.value(row)));
+        }

Review Comment:
   done



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

Reply via email to