@@ -213,6 +213,26 @@ TEST(GroupByNode, NoSkipNulls) {
213
213
AssertExecBatchesEqualIgnoringOrder (out_schema, {expected_batch}, out_batches.batches );
214
214
}
215
215
216
+ TEST (GroupByNode, BasicParallel) {
217
+ const int64_t num_batches = 8 ;
218
+
219
+ std::vector<ExecBatch> batches (num_batches, ExecBatchFromJSON ({int32 ()}, " [[42]]" ));
220
+
221
+ Declaration plan = Declaration::Sequence (
222
+ {{" exec_batch_source" ,
223
+ ExecBatchSourceNodeOptions (schema ({field (" key" , int32 ())}), batches)},
224
+ {" aggregate" , AggregateNodeOptions{/* aggregates=*/ {{" hash_count_all" , " count(*)" }},
225
+ /* keys=*/ {" key" }}}});
226
+
227
+ ASSERT_OK_AND_ASSIGN (BatchesWithCommonSchema out_batches,
228
+ DeclarationToExecBatches (plan));
229
+
230
+ ExecBatch expected_batch = ExecBatchFromJSON (
231
+ {int32 (), int64 ()}, " [[42, " + std::to_string (num_batches) + " ]]" );
232
+ AssertExecBatchesEqualIgnoringOrder (out_batches.schema , {expected_batch},
233
+ out_batches.batches );
234
+ }
235
+
216
236
TEST (ScalarAggregateNode, AnyAll) {
217
237
// GH-43768: boolean_any and boolean_all with constant input should work well
218
238
// when min_count != 0.
@@ -265,5 +285,24 @@ TEST(ScalarAggregateNode, AnyAll) {
265
285
}
266
286
}
267
287
288
+ TEST (ScalarAggregateNode, BasicParallel) {
289
+ const int64_t num_batches = 8 ;
290
+
291
+ std::vector<ExecBatch> batches (num_batches, ExecBatchFromJSON ({int32 ()}, " [[42]]" ));
292
+
293
+ Declaration plan = Declaration::Sequence (
294
+ {{" exec_batch_source" ,
295
+ ExecBatchSourceNodeOptions (schema ({field (" " , int32 ())}), batches)},
296
+ {" aggregate" , AggregateNodeOptions{/* aggregates=*/ {{" count_all" , " count(*)" }}}}});
297
+
298
+ ASSERT_OK_AND_ASSIGN (BatchesWithCommonSchema out_batches,
299
+ DeclarationToExecBatches (plan));
300
+
301
+ ExecBatch expected_batch =
302
+ ExecBatchFromJSON ({int64 ()}, " [[" + std::to_string (num_batches) + " ]]" );
303
+ AssertExecBatchesEqualIgnoringOrder (out_batches.schema , {expected_batch},
304
+ out_batches.batches );
305
+ }
306
+
268
307
} // namespace acero
269
308
} // namespace arrow
0 commit comments