Skip to content

Commit df82d4c

Browse files
authored
GH-45279: [C++][Compute] Move all Grouper tests to grouper_test.cc (#45280)
### What changes are included in this PR? 1. Move tests for the Grouper and RowSegmenter implementations to `arrow/compute/row/grouper_test.cc` where they belong (this also makes `acero/hash_aggregate_test.cc` slightly shorter) 2. Introduce a `arrow_compute_testing` object library to hold compute-related testing utilities 3. Remove duplicate definitions of `ExecBatchFromJSON` from Dataset and Acero 4. Make `arrow/compute/kernels/test_util.h` internal ### Are these changes tested? Yes, by existing tests and CI. ### Are there any user-facing changes? No. * GitHub Issue: #45279 Authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
1 parent e434536 commit df82d4c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1226
-1193
lines changed

cpp/src/arrow/acero/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ if(ARROW_TESTING)
117117
if(ARROW_WITH_OPENTELEMETRY)
118118
target_link_libraries(arrow_acero_testing PRIVATE ${ARROW_OPENTELEMETRY_LIBS})
119119
endif()
120-
list(APPEND ARROW_ACERO_TEST_LINK_LIBS arrow_acero_testing)
120+
list(APPEND ARROW_ACERO_TEST_LINK_LIBS arrow_acero_testing arrow_compute_testing)
121121
endif()
122122
# Only for hash_aggregate_test.cc.
123123
if(ARROW_USE_BOOST)

cpp/src/arrow/acero/aggregate_node.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include "arrow/acero/visibility.h"
2626
#include "arrow/compute/api_aggregate.h"
27+
#include "arrow/compute/test_util_internal.h"
2728
#include "arrow/compute/type_fwd.h"
2829
#include "arrow/result.h"
2930
#include "arrow/type_fwd.h"

cpp/src/arrow/acero/aggregate_node_test.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include "arrow/acero/test_util_internal.h"
2626
#include "arrow/compute/api_aggregate.h"
27+
#include "arrow/compute/test_util_internal.h"
2728
#include "arrow/result.h"
2829
#include "arrow/table.h"
2930
#include "arrow/testing/gtest_util.h"
@@ -32,6 +33,8 @@
3233

3334
namespace arrow {
3435

36+
using compute::ExecBatchFromJSON;
37+
3538
namespace acero {
3639

3740
Result<std::shared_ptr<Table>> TableGroupBy(

cpp/src/arrow/acero/asof_join_node_test.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@
4141
#include "arrow/acero/util.h"
4242
#include "arrow/api.h"
4343
#include "arrow/compute/api_scalar.h"
44-
#include "arrow/compute/kernels/test_util.h"
44+
#include "arrow/compute/cast.h"
4545
#include "arrow/compute/row/row_encoder_internal.h"
46+
#include "arrow/compute/test_util_internal.h"
4647
#include "arrow/testing/gtest_util.h"
4748
#include "arrow/testing/matchers.h"
4849
#include "arrow/testing/random.h"
@@ -67,6 +68,7 @@ namespace arrow {
6768

6869
using compute::Cast;
6970
using compute::Divide;
71+
using compute::ExecBatchFromJSON;
7072
using compute::Multiply;
7173
using compute::Subtract;
7274

0 commit comments

Comments
 (0)