Skip to content

Commit

Permalink
GH-34630: [C++] Second block of refactoring to move acero out of liba…
Browse files Browse the repository at this point in the history
…rrow (#34575)

### Rationale for this change

This is the second and last block of refactoring before moving acero out
of libarrow. This PR removes the remaining dependencies from libarrow
into the compute/exec directory.

### What changes are included in this PR?

In detail:

* compute/exec/expression is moved inside compute since it is needed in
several kernels
* all compute/exec specific include files are removed from compute/api.h
* light_array_exec_test.cc i(introduced in the previous refactoring) s
merged back into light_array_test
* testing generators are refactored to remove the need for
exec/options.h
* some utilities are moved from compute/exec/util to compute/util
* updated python and r libraries usage of moved files

### Are these changes tested?

Yes using existing tests (some of which have been updated due to
refactoring).

### Are there any user-facing changes?

no
* Issue: #15280
* Closes: #34630
  • Loading branch information
ildipo authored Mar 18, 2023
1 parent 682c112 commit 8524572
Show file tree
Hide file tree
Showing 62 changed files with 328 additions and 336 deletions.
1 change: 1 addition & 0 deletions c_glib/arrow-glib/compute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#pragma once

#include <arrow/compute/api.h>
#include <arrow/compute/exec/exec_plan.h>

#include <arrow-glib/compute.h>

Expand Down
2 changes: 1 addition & 1 deletion c_glib/arrow-glib/expression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#pragma once

#include <arrow/compute/exec/expression.h>
#include <arrow/compute/expression.h>

#include <arrow-glib/expression.h>

Expand Down
2 changes: 1 addition & 1 deletion cpp/examples/arrow/compute_register_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#include <arrow/api.h>
#include <arrow/compute/api.h>
#include <arrow/compute/exec/exec_plan.h>
#include <arrow/compute/exec/expression.h>
#include <arrow/compute/exec/options.h>
#include <arrow/util/async_generator.h>
#include <arrow/util/future.h>
#include "arrow/compute/expression.h"

#include <cstdlib>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion cpp/examples/arrow/dataset_documentation_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include <arrow/api.h>
#include <arrow/compute/cast.h>
#include <arrow/compute/exec/expression.h>
#include <arrow/dataset/dataset.h>
#include <arrow/dataset/discovery.h>
#include <arrow/dataset/file_base.h>
Expand All @@ -31,6 +30,7 @@
#include <arrow/ipc/writer.h>
#include <arrow/util/iterator.h>
#include <parquet/arrow/writer.h>
#include "arrow/compute/expression.h"

#include <iostream>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion cpp/examples/arrow/dataset_parquet_scan_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
// under the License.

#include <arrow/api.h>
#include <arrow/compute/exec/expression.h>
#include <arrow/dataset/dataset.h>
#include <arrow/dataset/discovery.h>
#include <arrow/dataset/file_base.h>
#include <arrow/dataset/file_parquet.h>
#include <arrow/dataset/scanner.h>
#include <arrow/filesystem/filesystem.h>
#include <arrow/filesystem/path_util.h>
#include "arrow/compute/expression.h"

#include <cstdlib>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion cpp/examples/arrow/dataset_skyhook_scan_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
// under the License.

#include <arrow/api.h>
#include <arrow/compute/exec/expression.h>
#include <arrow/dataset/dataset.h>
#include <arrow/dataset/discovery.h>
#include <arrow/dataset/file_base.h>
#include <arrow/dataset/scanner.h>
#include <arrow/filesystem/filesystem.h>
#include <arrow/filesystem/path_util.h>
#include <skyhook/client/file_skyhook.h>
#include "arrow/compute/expression.h"

#include <cstdlib>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion cpp/examples/arrow/join_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <arrow/api.h>
#include <arrow/compute/api.h>
#include <arrow/compute/exec/exec_plan.h>
#include <arrow/compute/exec/expression.h>
#include <arrow/csv/api.h>
#include "arrow/compute/expression.h"

#include <arrow/dataset/dataset.h>
#include <arrow/dataset/plan.h>
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ list(APPEND
compute/exec/asof_join_node.cc
compute/exec/bloom_filter.cc
compute/exec/exec_plan.cc
compute/exec/expression.cc
compute/expression.cc
compute/exec/fetch_node.cc
compute/exec/filter_node.cc
compute/exec/hash_join.cc
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/arrow/compute/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ add_arrow_compute_test(internals_test
kernel_test.cc
light_array_test.cc
registry_test.cc
key_hash_test.cc)
key_hash_test.cc
expression_test.cc)

add_arrow_benchmark(function_benchmark PREFIX "arrow-compute")

Expand Down
14 changes: 3 additions & 11 deletions cpp/src/arrow/compute/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,16 @@
/// @{
/// @}

#include "arrow/compute/exec/expression.h" // IWYU pragma: export

/// \defgroup execnode-options Concrete option classes for ExecNode options
/// @{
/// @}

#include "arrow/compute/exec/options.h" // IWYU pragma: export
#include "arrow/compute/expression.h" // IWYU pragma: export

/// \defgroup execnode-row Utilities for working with data in a row-major format
/// @{
/// @}

#include "arrow/compute/row/grouper.h" // IWYU pragma: export

/// \defgroup execnode-components Components associated with ExecNode
/// \defgroup execnode-components Components associated with ExecBatch
/// @{
/// @}

#include "arrow/compute/exec.h" // IWYU pragma: export
#include "arrow/compute/exec/exec_plan.h" // IWYU pragma: export
#include "arrow/compute/exec/groupby.h" // IWYU pragma: export
#include "arrow/compute/exec.h" // IWYU pragma: export
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/exec.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <vector>

#include "arrow/array/data.h"
#include "arrow/compute/exec/expression.h"
#include "arrow/compute/expression.h"
#include "arrow/compute/type_fwd.h"
#include "arrow/datum.h"
#include "arrow/result.h"
Expand Down
8 changes: 1 addition & 7 deletions cpp/src/arrow/compute/exec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@

arrow_install_all_headers("arrow/compute/exec")

add_arrow_compute_test(expression_test
add_arrow_compute_test(subtree_test
REQUIRE_ALL_KERNELS
PREFIX
"arrow-compute"
SOURCES
expression_test.cc
subtree_test.cc)

add_arrow_compute_test(plan_test
Expand Down Expand Up @@ -69,11 +68,6 @@ add_arrow_compute_test(util_test
SOURCES
util_test.cc
task_util_test.cc)
add_arrow_compute_test(light_array_exec_test
PREFIX
"arrow-compute"
SOURCES
light_array_exec_test.cc)

add_arrow_benchmark(expression_benchmark PREFIX "arrow-compute")

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/exec/exec_plan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#include <unordered_set>

#include "arrow/compute/exec.h"
#include "arrow/compute/exec/expression.h"
#include "arrow/compute/exec/options.h"
#include "arrow/compute/exec/query_context.h"
#include "arrow/compute/exec/task_util.h"
#include "arrow/compute/exec/util.h"
#include "arrow/compute/expression.h"
#include "arrow/compute/registry.h"
#include "arrow/datum.h"
#include "arrow/record_batch.h"
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/exec/exec_plan.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

#include "arrow/compute/api_vector.h"
#include "arrow/compute/exec.h"
#include "arrow/compute/exec/type_fwd.h"
#include "arrow/compute/ordering.h"
#include "arrow/compute/type_fwd.h"
#include "arrow/type_fwd.h"
#include "arrow/util/future.h"
#include "arrow/util/macros.h"
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/exec/expression_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include <thread>

#include "arrow/compute/cast.h"
#include "arrow/compute/exec/expression.h"
#include "arrow/compute/exec/test_util.h"
#include "arrow/compute/expression.h"
#include "arrow/dataset/partition.h"
#include "arrow/testing/generator.h"
#include "arrow/testing/gtest_util.h"
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/exec/fetch_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include "arrow/compute/exec.h"
#include "arrow/compute/exec/accumulation_queue.h"
#include "arrow/compute/exec/exec_plan.h"
#include "arrow/compute/exec/expression.h"
#include "arrow/compute/exec/map_node.h"
#include "arrow/compute/exec/options.h"
#include "arrow/compute/exec/query_context.h"
#include "arrow/compute/exec/util.h"
#include "arrow/compute/expression.h"
#include "arrow/datum.h"
#include "arrow/result.h"
#include "arrow/util/checked_cast.h"
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/exec/filter_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include "benchmark/benchmark.h"

#include "arrow/compute/exec/benchmark_util.h"
#include "arrow/compute/exec/expression.h"
#include "arrow/compute/exec/options.h"
#include "arrow/compute/expression.h"
#include "arrow/record_batch.h"
#include "arrow/testing/random.h"

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/exec/filter_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#include "arrow/compute/api_vector.h"
#include "arrow/compute/exec.h"
#include "arrow/compute/exec/exec_plan.h"
#include "arrow/compute/exec/expression.h"
#include "arrow/compute/exec/map_node.h"
#include "arrow/compute/exec/options.h"
#include "arrow/compute/exec/query_context.h"
#include "arrow/compute/expression.h"
#include "arrow/datum.h"
#include "arrow/result.h"
#include "arrow/util/checked_cast.h"
Expand Down
Loading

0 comments on commit 8524572

Please sign in to comment.