| 661 | } |
| 662 | |
| 663 | void CheckGroupedAggregateCase(const AggregateTestCase& test_case) { |
| 664 | ARROW_SCOPED_TRACE("function = ", test_case.function_id.ToString()); |
| 665 | std::shared_ptr<Table> output_table; |
| 666 | std::shared_ptr<acero::ExecPlan> plan = |
| 667 | PlanFromAggregateCase(test_case, &output_table, /*with_keys=*/true); |
| 668 | |
| 669 | plan->StartProducing(); |
| 670 | ASSERT_FINISHES_OK(plan->finished()); |
| 671 | |
| 672 | // The aggregate node's output is unpredictable so we sort by the key column |
| 673 | ASSERT_OK_AND_ASSIGN( |
| 674 | std::shared_ptr<Array> sort_indices, |
| 675 | compute::SortIndices(output_table, compute::SortOptions({compute::SortKey( |
| 676 | 0, compute::SortOrder::Ascending)}))); |
| 677 | ASSERT_OK_AND_ASSIGN(Datum sorted_table_datum, |
| 678 | compute::Take(output_table, sort_indices)); |
| 679 | output_table = sorted_table_datum.table(); |
| 680 | ASSERT_OK_AND_ASSIGN(output_table, |
| 681 | output_table->SelectColumns({output_table->num_columns() - 1})); |
| 682 | |
| 683 | std::shared_ptr<Table> expected_output = |
| 684 | GetOutputTableForAggregateCase(test_case.output_type, test_case.group_outputs); |
| 685 | |
| 686 | AssertTablesEqual(*expected_output, *output_table, /*same_chunk_layout=*/false); |
| 687 | } |
| 688 | |
| 689 | void CheckAggregateCases(const std::vector<AggregateTestCase>& test_cases) { |
| 690 | for (const AggregateTestCase& test_case : test_cases) { |
no test coverage detected