This is an automated email from the ASF dual-hosted git repository.
westonpace pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new b29441c324 GH-34035: [C++] Internal header file included from public
one breaks build of external projects (#34036)
b29441c324 is described below
commit b29441c32447096802ea71135efe911817b84330
Author: rtpsw <[email protected]>
AuthorDate: Sat Feb 4 00:18:21 2023 +0200
GH-34035: [C++] Internal header file included from public one breaks build
of external projects (#34036)
See #34035
* Closes: #34035
Authored-by: Yaron Gvili <[email protected]>
Signed-off-by: Weston Pace <[email protected]>
---
cpp/src/arrow/compute/exec/aggregate_node.cc | 6 ++-
cpp/src/arrow/compute/exec/asof_join_node_test.cc | 2 +-
cpp/src/arrow/compute/exec/hash_join.cc | 2 +-
cpp/src/arrow/compute/exec/hash_join_benchmark.cc | 2 +-
cpp/src/arrow/compute/exec/hash_join_dict.h | 2 +-
cpp/src/arrow/compute/exec/hash_join_node.cc | 3 +-
cpp/src/arrow/compute/exec/hash_join_node_test.cc | 2 +-
cpp/src/arrow/compute/exec/map_node.cc | 3 +-
cpp/src/arrow/compute/exec/map_node.h | 2 +-
cpp/src/arrow/compute/exec/project_node.cc | 2 +-
cpp/src/arrow/compute/exec/sink_node.cc | 8 ++--
cpp/src/arrow/compute/exec/source_node.cc | 3 +-
cpp/src/arrow/compute/exec/swiss_join.cc | 4 +-
cpp/src/arrow/compute/exec/swiss_join_avx2.cc | 2 +-
.../exec/{swiss_join.h => swiss_join_internal.h} | 2 +-
cpp/src/arrow/compute/exec/tpch_node_test.cc | 2 +-
cpp/src/arrow/compute/exec/union_node.cc | 5 ++-
cpp/src/arrow/compute/exec/util.cc | 39 +++++++++++++++++
cpp/src/arrow/compute/exec/util.h | 51 +++++-----------------
cpp/src/arrow/compute/function.cc | 2 +-
cpp/src/arrow/compute/kernels/aggregate_basic.cc | 2 +-
.../compute/kernels/aggregate_basic_internal.h | 2 +-
cpp/src/arrow/compute/kernels/aggregate_mode.cc | 2 +-
.../arrow/compute/kernels/aggregate_quantile.cc | 2 +-
cpp/src/arrow/compute/kernels/aggregate_tdigest.cc | 2 +-
cpp/src/arrow/compute/kernels/aggregate_var_std.cc | 2 +-
.../compute/kernels/base_arithmetic_internal.h | 2 +-
.../kernels/{common.h => common_internal.h} | 0
cpp/src/arrow/compute/kernels/hash_aggregate.cc | 4 +-
cpp/src/arrow/compute/kernels/row_encoder.cc | 2 +-
.../{row_encoder.h => row_encoder_internal.h} | 0
cpp/src/arrow/compute/kernels/scalar_arithmetic.cc | 2 +-
cpp/src/arrow/compute/kernels/scalar_boolean.cc | 2 +-
.../arrow/compute/kernels/scalar_cast_boolean.cc | 2 +-
.../arrow/compute/kernels/scalar_cast_extension.cc | 2 +-
.../arrow/compute/kernels/scalar_cast_internal.cc | 2 +-
.../arrow/compute/kernels/scalar_cast_internal.h | 2 +-
.../arrow/compute/kernels/scalar_cast_nested.cc | 2 +-
.../arrow/compute/kernels/scalar_cast_numeric.cc | 2 +-
.../arrow/compute/kernels/scalar_cast_string.cc | 2 +-
.../arrow/compute/kernels/scalar_cast_temporal.cc | 2 +-
cpp/src/arrow/compute/kernels/scalar_compare.cc | 2 +-
cpp/src/arrow/compute/kernels/scalar_nested.cc | 2 +-
cpp/src/arrow/compute/kernels/scalar_random.cc | 2 +-
cpp/src/arrow/compute/kernels/scalar_round.cc | 2 +-
cpp/src/arrow/compute/kernels/scalar_set_lookup.cc | 2 +-
.../compute/kernels/scalar_set_lookup_benchmark.cc | 2 +-
.../arrow/compute/kernels/scalar_string_internal.h | 2 +-
.../compute/kernels/scalar_temporal_binary.cc | 2 +-
.../arrow/compute/kernels/scalar_temporal_unary.cc | 2 +-
cpp/src/arrow/compute/kernels/scalar_validity.cc | 2 +-
cpp/src/arrow/compute/kernels/vector_array_sort.cc | 2 +-
.../arrow/compute/kernels/vector_cumulative_ops.cc | 2 +-
cpp/src/arrow/compute/kernels/vector_hash.cc | 2 +-
cpp/src/arrow/compute/kernels/vector_nested.cc | 2 +-
cpp/src/arrow/compute/kernels/vector_replace.cc | 2 +-
cpp/src/arrow/compute/kernels/vector_selection.cc | 2 +-
cpp/src/arrow/compute/row/grouper.cc | 2 +-
cpp/src/arrow/dataset/dataset_test.cc | 2 +-
cpp/src/arrow/dataset/discovery_test.cc | 2 +-
cpp/src/arrow/dataset/file_csv_test.cc | 2 +-
cpp/src/arrow/dataset/file_ipc_test.cc | 2 +-
cpp/src/arrow/dataset/file_orc_test.cc | 2 +-
cpp/src/arrow/dataset/file_parquet_test.cc | 2 +-
cpp/src/arrow/dataset/file_test.cc | 2 +-
cpp/src/arrow/dataset/partition_test.cc | 2 +-
cpp/src/arrow/dataset/scan_node.cc | 6 ++-
cpp/src/arrow/dataset/scanner_benchmark.cc | 2 +-
cpp/src/arrow/dataset/scanner_test.cc | 2 +-
.../dataset/{test_util.h => test_util_internal.h} | 0
cpp/src/arrow/util/type_fwd.h | 5 +++
71 files changed, 135 insertions(+), 114 deletions(-)
diff --git a/cpp/src/arrow/compute/exec/aggregate_node.cc
b/cpp/src/arrow/compute/exec/aggregate_node.cc
index ac0375f2ce..5efb49180f 100644
--- a/cpp/src/arrow/compute/exec/aggregate_node.cc
+++ b/cpp/src/arrow/compute/exec/aggregate_node.cc
@@ -70,7 +70,7 @@ void AggregatesToString(std::stringstream* ss, const Schema&
input_schema,
*ss << ']';
}
-class ScalarAggregateNode : public ExecNode, public
TracedNode<ScalarAggregateNode> {
+class ScalarAggregateNode : public ExecNode, public TracedNode {
public:
ScalarAggregateNode(ExecPlan* plan, std::vector<ExecNode*> inputs,
std::shared_ptr<Schema> output_schema,
@@ -80,6 +80,7 @@ class ScalarAggregateNode : public ExecNode, public
TracedNode<ScalarAggregateNo
std::vector<std::vector<std::unique_ptr<KernelState>>>
states)
: ExecNode(plan, std::move(inputs), {"target"},
/*output_schema=*/std::move(output_schema)),
+ TracedNode(this),
target_fieldsets_(std::move(target_fieldsets)),
aggs_(std::move(aggs)),
kernels_(std::move(kernels)),
@@ -250,7 +251,7 @@ class ScalarAggregateNode : public ExecNode, public
TracedNode<ScalarAggregateNo
AtomicCounter input_counter_;
};
-class GroupByNode : public ExecNode, public TracedNode<GroupByNode> {
+class GroupByNode : public ExecNode, public TracedNode {
public:
GroupByNode(ExecNode* input, std::shared_ptr<Schema> output_schema,
std::vector<int> key_field_ids,
@@ -258,6 +259,7 @@ class GroupByNode : public ExecNode, public
TracedNode<GroupByNode> {
std::vector<Aggregate> aggs,
std::vector<const HashAggregateKernel*> agg_kernels)
: ExecNode(input->plan(), {input}, {"groupby"},
std::move(output_schema)),
+ TracedNode(this),
key_field_ids_(std::move(key_field_ids)),
agg_src_fieldsets_(std::move(agg_src_fieldsets)),
aggs_(std::move(aggs)),
diff --git a/cpp/src/arrow/compute/exec/asof_join_node_test.cc
b/cpp/src/arrow/compute/exec/asof_join_node_test.cc
index 5ac5b6fe81..91735dbdfe 100644
--- a/cpp/src/arrow/compute/exec/asof_join_node_test.cc
+++ b/cpp/src/arrow/compute/exec/asof_join_node_test.cc
@@ -30,7 +30,7 @@
#include "arrow/compute/exec/test_nodes.h"
#include "arrow/compute/exec/test_util.h"
#include "arrow/compute/exec/util.h"
-#include "arrow/compute/kernels/row_encoder.h"
+#include "arrow/compute/kernels/row_encoder_internal.h"
#include "arrow/compute/kernels/test_util.h"
#include "arrow/testing/gtest_util.h"
#include "arrow/testing/matchers.h"
diff --git a/cpp/src/arrow/compute/exec/hash_join.cc
b/cpp/src/arrow/compute/exec/hash_join.cc
index a2d47ddf4e..7a654a0514 100644
--- a/cpp/src/arrow/compute/exec/hash_join.cc
+++ b/cpp/src/arrow/compute/exec/hash_join.cc
@@ -27,7 +27,7 @@
#include "arrow/compute/exec/hash_join_dict.h"
#include "arrow/compute/exec/task_util.h"
-#include "arrow/compute/kernels/row_encoder.h"
+#include "arrow/compute/kernels/row_encoder_internal.h"
#include "arrow/compute/row/encode_internal.h"
#include "arrow/util/tracing_internal.h"
diff --git a/cpp/src/arrow/compute/exec/hash_join_benchmark.cc
b/cpp/src/arrow/compute/exec/hash_join_benchmark.cc
index 4181c4bbc9..156f55034c 100644
--- a/cpp/src/arrow/compute/exec/hash_join_benchmark.cc
+++ b/cpp/src/arrow/compute/exec/hash_join_benchmark.cc
@@ -23,7 +23,7 @@
#include "arrow/compute/exec/options.h"
#include "arrow/compute/exec/test_util.h"
#include "arrow/compute/exec/util.h"
-#include "arrow/compute/kernels/row_encoder.h"
+#include "arrow/compute/kernels/row_encoder_internal.h"
#include "arrow/testing/random.h"
#include "arrow/util/thread_pool.h"
diff --git a/cpp/src/arrow/compute/exec/hash_join_dict.h
b/cpp/src/arrow/compute/exec/hash_join_dict.h
index 26605cc449..6c6a4014f4 100644
--- a/cpp/src/arrow/compute/exec/hash_join_dict.h
+++ b/cpp/src/arrow/compute/exec/hash_join_dict.h
@@ -22,7 +22,7 @@
#include "arrow/compute/exec.h"
#include "arrow/compute/exec/schema_util.h"
-#include "arrow/compute/kernels/row_encoder.h"
+#include "arrow/compute/kernels/row_encoder_internal.h"
#include "arrow/result.h"
#include "arrow/status.h"
#include "arrow/type.h"
diff --git a/cpp/src/arrow/compute/exec/hash_join_node.cc
b/cpp/src/arrow/compute/exec/hash_join_node.cc
index 8d4c635a78..6155ebd603 100644
--- a/cpp/src/arrow/compute/exec/hash_join_node.cc
+++ b/cpp/src/arrow/compute/exec/hash_join_node.cc
@@ -678,7 +678,7 @@ bool HashJoinSchema::HasLargeBinary() const {
return false;
}
-class HashJoinNode : public ExecNode, public TracedNode<HashJoinNode> {
+class HashJoinNode : public ExecNode, public TracedNode {
public:
HashJoinNode(ExecPlan* plan, NodeVector inputs, const HashJoinNodeOptions&
join_options,
std::shared_ptr<Schema> output_schema,
@@ -686,6 +686,7 @@ class HashJoinNode : public ExecNode, public
TracedNode<HashJoinNode> {
std::unique_ptr<HashJoinImpl> impl)
: ExecNode(plan, inputs, {"left", "right"},
/*output_schema=*/std::move(output_schema)),
+ TracedNode(this),
join_type_(join_options.join_type),
key_cmp_(join_options.key_cmp),
filter_(std::move(filter)),
diff --git a/cpp/src/arrow/compute/exec/hash_join_node_test.cc
b/cpp/src/arrow/compute/exec/hash_join_node_test.cc
index 66482ddcb6..d8466dc0ea 100644
--- a/cpp/src/arrow/compute/exec/hash_join_node_test.cc
+++ b/cpp/src/arrow/compute/exec/hash_join_node_test.cc
@@ -26,7 +26,7 @@
#include "arrow/compute/exec/options.h"
#include "arrow/compute/exec/test_util.h"
#include "arrow/compute/exec/util.h"
-#include "arrow/compute/kernels/row_encoder.h"
+#include "arrow/compute/kernels/row_encoder_internal.h"
#include "arrow/compute/kernels/test_util.h"
#include "arrow/testing/extension_type.h"
#include "arrow/testing/gtest_util.h"
diff --git a/cpp/src/arrow/compute/exec/map_node.cc
b/cpp/src/arrow/compute/exec/map_node.cc
index 2576cb6259..9166ad5c68 100644
--- a/cpp/src/arrow/compute/exec/map_node.cc
+++ b/cpp/src/arrow/compute/exec/map_node.cc
@@ -36,7 +36,8 @@ namespace compute {
MapNode::MapNode(ExecPlan* plan, std::vector<ExecNode*> inputs,
std::shared_ptr<Schema> output_schema)
: ExecNode(plan, std::move(inputs), /*input_labels=*/{"target"},
- std::move(output_schema)) {}
+ std::move(output_schema)),
+ TracedNode(this) {}
Status MapNode::InputFinished(ExecNode* input, int total_batches) {
DCHECK_EQ(input, inputs_[0]);
diff --git a/cpp/src/arrow/compute/exec/map_node.h
b/cpp/src/arrow/compute/exec/map_node.h
index 2e62030d64..5a866bdd97 100644
--- a/cpp/src/arrow/compute/exec/map_node.h
+++ b/cpp/src/arrow/compute/exec/map_node.h
@@ -41,7 +41,7 @@ namespace compute {
///
/// An AtomicCounter is used to keep track of when all data has arrived. When
it
/// has the Finish() method will be invoked
-class ARROW_EXPORT MapNode : public ExecNode, public TracedNode<MapNode> {
+class ARROW_EXPORT MapNode : public ExecNode, public TracedNode {
public:
MapNode(ExecPlan* plan, std::vector<ExecNode*> inputs,
std::shared_ptr<Schema> output_schema);
diff --git a/cpp/src/arrow/compute/exec/project_node.cc
b/cpp/src/arrow/compute/exec/project_node.cc
index e355d012e1..3bff2d6ee3 100644
--- a/cpp/src/arrow/compute/exec/project_node.cc
+++ b/cpp/src/arrow/compute/exec/project_node.cc
@@ -39,7 +39,7 @@ using internal::checked_cast;
namespace compute {
namespace {
-class ProjectNode : public MapNode, public TracedNode<ProjectNode> {
+class ProjectNode : public MapNode {
public:
ProjectNode(ExecPlan* plan, std::vector<ExecNode*> inputs,
std::shared_ptr<Schema> output_schema, std::vector<Expression>
exprs)
diff --git a/cpp/src/arrow/compute/exec/sink_node.cc
b/cpp/src/arrow/compute/exec/sink_node.cc
index 7481245ccf..0b179cd6cd 100644
--- a/cpp/src/arrow/compute/exec/sink_node.cc
+++ b/cpp/src/arrow/compute/exec/sink_node.cc
@@ -97,13 +97,14 @@ class BackpressureReservoir : public BackpressureMonitor {
const uint64_t pause_if_above_;
};
-class SinkNode : public ExecNode, public TracedNode<SinkNode> {
+class SinkNode : public ExecNode, public TracedNode {
public:
SinkNode(ExecPlan* plan, std::vector<ExecNode*> inputs,
AsyncGenerator<std::optional<ExecBatch>>* generator,
std::shared_ptr<Schema>* schema, BackpressureOptions backpressure,
BackpressureMonitor** backpressure_monitor_out)
: ExecNode(plan, std::move(inputs), {"collected"}, {}),
+ TracedNode(this),
backpressure_queue_(backpressure.resume_if_below,
backpressure.pause_if_above),
push_gen_(),
producer_(push_gen_.producer()),
@@ -260,14 +261,13 @@ class SinkNode : public ExecNode, public
TracedNode<SinkNode> {
// is finished. Use SinkNode if you are transferring the ownership of the
data to another
// system. Use ConsumingSinkNode if the data is being consumed within the
exec plan (i.e.
// the exec plan should not complete until the consumption has completed).
-class ConsumingSinkNode : public ExecNode,
- public BackpressureControl,
- public TracedNode<ConsumingSinkNode> {
+class ConsumingSinkNode : public ExecNode, public BackpressureControl, public
TracedNode {
public:
ConsumingSinkNode(ExecPlan* plan, std::vector<ExecNode*> inputs,
std::shared_ptr<SinkNodeConsumer> consumer,
std::vector<std::string> names)
: ExecNode(plan, std::move(inputs), {"to_consume"}, {}),
+ TracedNode(this),
consumer_(std::move(consumer)),
names_(std::move(names)) {}
diff --git a/cpp/src/arrow/compute/exec/source_node.cc
b/cpp/src/arrow/compute/exec/source_node.cc
index fbd84e3ca4..ffb19d2e10 100644
--- a/cpp/src/arrow/compute/exec/source_node.cc
+++ b/cpp/src/arrow/compute/exec/source_node.cc
@@ -50,10 +50,11 @@ using internal::MapVector;
namespace compute {
namespace {
-struct SourceNode : ExecNode, public TracedNode<SourceNode> {
+struct SourceNode : ExecNode, public TracedNode {
SourceNode(ExecPlan* plan, std::shared_ptr<Schema> output_schema,
AsyncGenerator<std::optional<ExecBatch>> generator)
: ExecNode(plan, {}, {}, std::move(output_schema)),
+ TracedNode(this),
generator_(std::move(generator)) {}
static Result<ExecNode*> Make(ExecPlan* plan, std::vector<ExecNode*> inputs,
diff --git a/cpp/src/arrow/compute/exec/swiss_join.cc
b/cpp/src/arrow/compute/exec/swiss_join.cc
index d0c9dbe097..de9b720c48 100644
--- a/cpp/src/arrow/compute/exec/swiss_join.cc
+++ b/cpp/src/arrow/compute/exec/swiss_join.cc
@@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-#include "arrow/compute/exec/swiss_join.h"
#include <sys/stat.h>
#include <algorithm> // std::upper_bound
#include <cstdio>
@@ -24,8 +23,9 @@
#include "arrow/array/util.h" // MakeArrayFromScalar
#include "arrow/compute/exec/hash_join.h"
#include "arrow/compute/exec/key_hash.h"
+#include "arrow/compute/exec/swiss_join_internal.h"
#include "arrow/compute/exec/util.h"
-#include "arrow/compute/kernels/row_encoder.h"
+#include "arrow/compute/kernels/row_encoder_internal.h"
#include "arrow/compute/row/compare_internal.h"
#include "arrow/compute/row/encode_internal.h"
#include "arrow/util/bit_util.h"
diff --git a/cpp/src/arrow/compute/exec/swiss_join_avx2.cc
b/cpp/src/arrow/compute/exec/swiss_join_avx2.cc
index 261b458132..da43370918 100644
--- a/cpp/src/arrow/compute/exec/swiss_join_avx2.cc
+++ b/cpp/src/arrow/compute/exec/swiss_join_avx2.cc
@@ -17,7 +17,7 @@
#include <immintrin.h>
-#include "arrow/compute/exec/swiss_join.h"
+#include "arrow/compute/exec/swiss_join_internal.h"
#include "arrow/util/bit_util.h"
namespace arrow {
diff --git a/cpp/src/arrow/compute/exec/swiss_join.h
b/cpp/src/arrow/compute/exec/swiss_join_internal.h
similarity index 99%
rename from cpp/src/arrow/compute/exec/swiss_join.h
rename to cpp/src/arrow/compute/exec/swiss_join_internal.h
index cbbd6d0ca2..355aff7094 100644
--- a/cpp/src/arrow/compute/exec/swiss_join.h
+++ b/cpp/src/arrow/compute/exec/swiss_join_internal.h
@@ -23,7 +23,7 @@
#include "arrow/compute/exec/partition_util.h"
#include "arrow/compute/exec/schema_util.h"
#include "arrow/compute/exec/task_util.h"
-#include "arrow/compute/kernels/row_encoder.h"
+#include "arrow/compute/kernels/row_encoder_internal.h"
#include "arrow/compute/light_array.h"
#include "arrow/compute/row/encode_internal.h"
diff --git a/cpp/src/arrow/compute/exec/tpch_node_test.cc
b/cpp/src/arrow/compute/exec/tpch_node_test.cc
index d3bae1c768..640a200e4e 100644
--- a/cpp/src/arrow/compute/exec/tpch_node_test.cc
+++ b/cpp/src/arrow/compute/exec/tpch_node_test.cc
@@ -27,7 +27,7 @@
#include "arrow/compute/exec/test_util.h"
#include "arrow/compute/exec/tpch_node.h"
#include "arrow/compute/exec/util.h"
-#include "arrow/compute/kernels/row_encoder.h"
+#include "arrow/compute/kernels/row_encoder_internal.h"
#include "arrow/compute/kernels/test_util.h"
#include "arrow/testing/gtest_util.h"
#include "arrow/testing/matchers.h"
diff --git a/cpp/src/arrow/compute/exec/union_node.cc
b/cpp/src/arrow/compute/exec/union_node.cc
index ae96751723..59c1f91428 100644
--- a/cpp/src/arrow/compute/exec/union_node.cc
+++ b/cpp/src/arrow/compute/exec/union_node.cc
@@ -46,11 +46,12 @@ std::vector<std::string> GetInputLabels(const
ExecNode::NodeVector& inputs) {
}
} // namespace
-class UnionNode : public ExecNode, public TracedNode<UnionNode> {
+class UnionNode : public ExecNode, public TracedNode {
public:
UnionNode(ExecPlan* plan, std::vector<ExecNode*> inputs)
: ExecNode(plan, inputs, GetInputLabels(inputs),
- /*output_schema=*/inputs[0]->output_schema()) {
+ /*output_schema=*/inputs[0]->output_schema()),
+ TracedNode(this) {
bool counter_completed =
input_count_.SetTotal(static_cast<int>(inputs.size()));
ARROW_DCHECK(counter_completed == false);
}
diff --git a/cpp/src/arrow/compute/exec/util.cc
b/cpp/src/arrow/compute/exec/util.cc
index 2dd1398b98..752f8cac76 100644
--- a/cpp/src/arrow/compute/exec/util.cc
+++ b/cpp/src/arrow/compute/exec/util.cc
@@ -21,6 +21,7 @@
#include "arrow/table.h"
#include "arrow/util/bit_util.h"
#include "arrow/util/bitmap_ops.h"
+#include "arrow/util/tracing_internal.h"
#include "arrow/util/ubsan.h"
namespace arrow {
@@ -404,5 +405,43 @@ Future<> TableSinkNodeConsumer::Finish() {
return Status::OK();
}
+[[nodiscard]] ::arrow::internal::tracing::Scope
TracedNode::TraceStartProducing(
+ std::string extra_details) const {
+ std::string node_kind(node_->kind_name());
+ util::tracing::Span span;
+ return START_SCOPED_SPAN(
+ span, node_kind + "::StartProducing",
+ {{"node.details", extra_details}, {"node.label", node_->label()}});
+}
+
+void TracedNode::NoteStartProducing(std::string extra_details) const {
+ std::string node_kind(node_->kind_name());
+ EVENT_ON_CURRENT_SPAN(node_kind + "::StartProducing", {{"node.details",
extra_details},
+ {"node.label",
node_->label()}});
+}
+
+[[nodiscard]] ::arrow::internal::tracing::Scope TracedNode::TraceInputReceived(
+ const ExecBatch& batch) const {
+ std::string node_kind(node_->kind_name());
+ util::tracing::Span span;
+ return START_SCOPED_SPAN(
+ span, node_kind + "::InputReceived",
+ {{"node.label", node_->label()}, {"node.batch_length", batch.length}});
+}
+
+void TracedNode::NoteInputReceived(const ExecBatch& batch) const {
+ std::string node_kind(node_->kind_name());
+ EVENT_ON_CURRENT_SPAN(
+ node_kind + "::InputReceived",
+ {{"node.label", node_->label()}, {"node.batch_length", batch.length}});
+}
+
+[[nodiscard]] ::arrow::internal::tracing::Scope TracedNode::TraceFinish()
const {
+ std::string node_kind(node_->kind_name());
+ util::tracing::Span span;
+ return START_SCOPED_SPAN(span, node_kind + "::Finish",
+ {{"node.label", node_->label()}});
+}
+
} // namespace compute
} // namespace arrow
diff --git a/cpp/src/arrow/compute/exec/util.h
b/cpp/src/arrow/compute/exec/util.h
index 93ed197d12..a2018277cd 100644
--- a/cpp/src/arrow/compute/exec/util.h
+++ b/cpp/src/arrow/compute/exec/util.h
@@ -36,7 +36,7 @@
#include "arrow/util/logging.h"
#include "arrow/util/mutex.h"
#include "arrow/util/thread_pool.h"
-#include "arrow/util/tracing_internal.h"
+#include "arrow/util/type_fwd.h"
#if defined(__clang__) || defined(__GNUC__)
#define BYTESWAP(x) __builtin_bswap64(x)
@@ -427,32 +427,20 @@ Result<Expression> ModifyExpression(Expression expr,
const PreVisit& pre,
/// CRTP helper for tracing helper functions
-template <typename T>
-class TracedNode {
+class ARROW_EXPORT TracedNode {
public:
// All nodes should call TraceStartProducing or NoteStartProducing exactly
once
// Most nodes will be fine with a call to NoteStartProducing since the
StartProducing
// call is usually fairly cheap and simply schedules tasks to fetch the
actual data.
+ explicit TracedNode(ExecNode* node) : node_(node) {}
+
// Create a span to record the StartProducing work
[[nodiscard]] ::arrow::internal::tracing::Scope TraceStartProducing(
- std::string extra_details) const {
- const T& self = cast();
- std::string node_kind(self.kind_name());
- util::tracing::Span span;
- return START_SCOPED_SPAN(
- span, node_kind + "::StartProducing",
- {{"node.details", extra_details}, {"node.label", self.label()}});
- }
+ std::string extra_details) const;
// Record a call to StartProducing without creating with a span
- void NoteStartProducing(std::string extra_details) const {
- const T& self = cast();
- std::string node_kind(self.kind_name());
- EVENT_ON_CURRENT_SPAN(
- node_kind + "::StartProducing",
- {{"node.details", extra_details}, {"node.label", self.label()}});
- }
+ void NoteStartProducing(std::string extra_details) const;
// All nodes should call TraceInputReceived for each batch they receive.
This call
// should track the time spent processing the batch. NoteInputReceived is
available
@@ -460,39 +448,20 @@ class TracedNode {
// Create a span to record the InputReceived work
[[nodiscard]] ::arrow::internal::tracing::Scope TraceInputReceived(
- const ExecBatch& batch) const {
- const T& self = cast();
- std::string node_kind(self.kind_name());
- util::tracing::Span span;
- return START_SCOPED_SPAN(
- span, node_kind + "::InputReceived",
- {{"node.label", self.label()}, {"node.batch_length", batch.length}});
- }
+ const ExecBatch& batch) const;
// Record a call to InputReceived without creating with a span
- void NoteInputReceived(const ExecBatch& batch) const {
- const T& self = cast();
- std::string node_kind(self.kind_name());
- EVENT_ON_CURRENT_SPAN(
- node_kind + "::InputReceived",
- {{"node.label", self.label()}, {"node.batch_length", batch.length}});
- }
+ void NoteInputReceived(const ExecBatch& batch) const;
// Create a span to record any "finish" work. This should NOT be called as
part of
// InputFinished and many nodes may not need to call this at all. This
should be used
// when a node has some extra work that has to be done once it has received
all of its
// data. For example, an aggregation node calculating aggregations. This
will
// typically be called as a result of InputFinished OR InputReceived.
- [[nodiscard]] ::arrow::internal::tracing::Scope TraceFinish() const {
- const T& self = cast();
- std::string node_kind(self.kind_name());
- util::tracing::Span span;
- return START_SCOPED_SPAN(span, node_kind + "::Finish",
- {{"node.label", self.label()}});
- }
+ [[nodiscard]] ::arrow::internal::tracing::Scope TraceFinish() const;
private:
- const T& cast() const { return static_cast<const T&>(*this); }
+ ExecNode* node_;
};
} // namespace compute
diff --git a/cpp/src/arrow/compute/function.cc
b/cpp/src/arrow/compute/function.cc
index 90e754f615..c0433145dd 100644
--- a/cpp/src/arrow/compute/function.cc
+++ b/cpp/src/arrow/compute/function.cc
@@ -26,7 +26,7 @@
#include "arrow/compute/exec.h"
#include "arrow/compute/exec_internal.h"
#include "arrow/compute/function_internal.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/registry.h"
#include "arrow/datum.h"
#include "arrow/util/cpu_info.h"
diff --git a/cpp/src/arrow/compute/kernels/aggregate_basic.cc
b/cpp/src/arrow/compute/kernels/aggregate_basic.cc
index 2f9c970759..cd54776051 100644
--- a/cpp/src/arrow/compute/kernels/aggregate_basic.cc
+++ b/cpp/src/arrow/compute/kernels/aggregate_basic.cc
@@ -18,7 +18,7 @@
#include "arrow/compute/api_aggregate.h"
#include "arrow/compute/kernels/aggregate_basic_internal.h"
#include "arrow/compute/kernels/aggregate_internal.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/util/cpu_info.h"
#include "arrow/util/hashing.h"
diff --git a/cpp/src/arrow/compute/kernels/aggregate_basic_internal.h
b/cpp/src/arrow/compute/kernels/aggregate_basic_internal.h
index aa89f8dc3b..e725483474 100644
--- a/cpp/src/arrow/compute/kernels/aggregate_basic_internal.h
+++ b/cpp/src/arrow/compute/kernels/aggregate_basic_internal.h
@@ -23,7 +23,7 @@
#include "arrow/compute/api_aggregate.h"
#include "arrow/compute/kernels/aggregate_internal.h"
#include "arrow/compute/kernels/codegen_internal.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/util/align_util.h"
#include "arrow/util/bit_block_counter.h"
diff --git a/cpp/src/arrow/compute/kernels/aggregate_mode.cc
b/cpp/src/arrow/compute/kernels/aggregate_mode.cc
index 7f379a0719..7f359ead6c 100644
--- a/cpp/src/arrow/compute/kernels/aggregate_mode.cc
+++ b/cpp/src/arrow/compute/kernels/aggregate_mode.cc
@@ -21,7 +21,7 @@
#include "arrow/compute/api_aggregate.h"
#include "arrow/compute/kernels/aggregate_internal.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/result.h"
#include "arrow/stl_allocator.h"
diff --git a/cpp/src/arrow/compute/kernels/aggregate_quantile.cc
b/cpp/src/arrow/compute/kernels/aggregate_quantile.cc
index 32a5d127dc..e675a1cec8 100644
--- a/cpp/src/arrow/compute/kernels/aggregate_quantile.cc
+++ b/cpp/src/arrow/compute/kernels/aggregate_quantile.cc
@@ -20,7 +20,7 @@
#include <vector>
#include "arrow/compute/api_aggregate.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/stl_allocator.h"
diff --git a/cpp/src/arrow/compute/kernels/aggregate_tdigest.cc
b/cpp/src/arrow/compute/kernels/aggregate_tdigest.cc
index 0e00537e3c..1dab92632e 100644
--- a/cpp/src/arrow/compute/kernels/aggregate_tdigest.cc
+++ b/cpp/src/arrow/compute/kernels/aggregate_tdigest.cc
@@ -17,7 +17,7 @@
#include "arrow/compute/api_aggregate.h"
#include "arrow/compute/kernels/aggregate_internal.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/util/bit_run_reader.h"
#include "arrow/util/tdigest.h"
diff --git a/cpp/src/arrow/compute/kernels/aggregate_var_std.cc
b/cpp/src/arrow/compute/kernels/aggregate_var_std.cc
index 1693e95278..e650285dfd 100644
--- a/cpp/src/arrow/compute/kernels/aggregate_var_std.cc
+++ b/cpp/src/arrow/compute/kernels/aggregate_var_std.cc
@@ -20,7 +20,7 @@
#include "arrow/compute/api_aggregate.h"
#include "arrow/compute/kernels/aggregate_internal.h"
#include "arrow/compute/kernels/aggregate_var_std_internal.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/util/bit_run_reader.h"
#include "arrow/util/int128_internal.h"
diff --git a/cpp/src/arrow/compute/kernels/base_arithmetic_internal.h
b/cpp/src/arrow/compute/kernels/base_arithmetic_internal.h
index 1cccdca148..65329e10db 100644
--- a/cpp/src/arrow/compute/kernels/base_arithmetic_internal.h
+++ b/cpp/src/arrow/compute/kernels/base_arithmetic_internal.h
@@ -18,7 +18,7 @@
#pragma once
#include "arrow/compute/api_scalar.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/type.h"
#include "arrow/type_traits.h"
diff --git a/cpp/src/arrow/compute/kernels/common.h
b/cpp/src/arrow/compute/kernels/common_internal.h
similarity index 100%
rename from cpp/src/arrow/compute/kernels/common.h
rename to cpp/src/arrow/compute/kernels/common_internal.h
diff --git a/cpp/src/arrow/compute/kernels/hash_aggregate.cc
b/cpp/src/arrow/compute/kernels/hash_aggregate.cc
index cec6390f92..c0459a1485 100644
--- a/cpp/src/arrow/compute/kernels/hash_aggregate.cc
+++ b/cpp/src/arrow/compute/kernels/hash_aggregate.cc
@@ -36,8 +36,8 @@
#include "arrow/compute/kernel.h"
#include "arrow/compute/kernels/aggregate_internal.h"
#include "arrow/compute/kernels/aggregate_var_std_internal.h"
-#include "arrow/compute/kernels/common.h"
-#include "arrow/compute/kernels/row_encoder.h"
+#include "arrow/compute/kernels/common_internal.h"
+#include "arrow/compute/kernels/row_encoder_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/compute/row/grouper.h"
#include "arrow/record_batch.h"
diff --git a/cpp/src/arrow/compute/kernels/row_encoder.cc
b/cpp/src/arrow/compute/kernels/row_encoder.cc
index f553708cca..8224eaa6d6 100644
--- a/cpp/src/arrow/compute/kernels/row_encoder.cc
+++ b/cpp/src/arrow/compute/kernels/row_encoder.cc
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#include "arrow/compute/kernels/row_encoder.h"
+#include "arrow/compute/kernels/row_encoder_internal.h"
#include "arrow/util/bitmap_writer.h"
#include "arrow/util/logging.h"
diff --git a/cpp/src/arrow/compute/kernels/row_encoder.h
b/cpp/src/arrow/compute/kernels/row_encoder_internal.h
similarity index 100%
rename from cpp/src/arrow/compute/kernels/row_encoder.h
rename to cpp/src/arrow/compute/kernels/row_encoder_internal.h
diff --git a/cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
b/cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
index 4de7755ef0..0021aa1108 100644
--- a/cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
@@ -26,7 +26,7 @@
#include "arrow/compute/api_scalar.h"
#include "arrow/compute/cast.h"
#include "arrow/compute/kernels/base_arithmetic_internal.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/type.h"
#include "arrow/type_traits.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_boolean.cc
b/cpp/src/arrow/compute/kernels/scalar_boolean.cc
index 27002b9180..a55ff71da1 100644
--- a/cpp/src/arrow/compute/kernels/scalar_boolean.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_boolean.cc
@@ -17,7 +17,7 @@
#include <array>
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/util/bit_util.h"
#include "arrow/util/bitmap.h"
#include "arrow/util/bitmap_ops.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_boolean.cc
b/cpp/src/arrow/compute/kernels/scalar_cast_boolean.cc
index bc29d75c57..8935b0d5f2 100644
--- a/cpp/src/arrow/compute/kernels/scalar_cast_boolean.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_cast_boolean.cc
@@ -18,7 +18,7 @@
// Cast types to boolean
#include "arrow/array/builder_primitive.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/scalar_cast_internal.h"
#include "arrow/util/value_parsing.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_extension.cc
b/cpp/src/arrow/compute/kernels/scalar_cast_extension.cc
index d2e2ab72f0..c32a6ef6de 100644
--- a/cpp/src/arrow/compute/kernels/scalar_cast_extension.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_cast_extension.cc
@@ -16,7 +16,7 @@
// under the License.
// Implementation of casting to extension types
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/scalar_cast_internal.h"
#include "arrow/scalar.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_internal.cc
b/cpp/src/arrow/compute/kernels/scalar_cast_internal.cc
index 27a86135a6..8cf5a04add 100644
--- a/cpp/src/arrow/compute/kernels/scalar_cast_internal.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_cast_internal.cc
@@ -17,7 +17,7 @@
#include "arrow/compute/kernels/scalar_cast_internal.h"
#include "arrow/compute/cast_internal.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/extension_type.h"
#include "arrow/util/checked_cast.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_internal.h
b/cpp/src/arrow/compute/kernels/scalar_cast_internal.h
index 4d9afab199..0a57e3381d 100644
--- a/cpp/src/arrow/compute/kernels/scalar_cast_internal.h
+++ b/cpp/src/arrow/compute/kernels/scalar_cast_internal.h
@@ -20,7 +20,7 @@
#include "arrow/compute/api_vector.h"
#include "arrow/compute/cast.h" // IWYU pragma: export
#include "arrow/compute/cast_internal.h" // IWYU pragma: export
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/util_internal.h"
namespace arrow {
diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_nested.cc
b/cpp/src/arrow/compute/kernels/scalar_cast_nested.cc
index 5b764efe26..28170a223d 100644
--- a/cpp/src/arrow/compute/kernels/scalar_cast_nested.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_cast_nested.cc
@@ -24,7 +24,7 @@
#include "arrow/array/builder_nested.h"
#include "arrow/compute/api_scalar.h"
#include "arrow/compute/cast.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/scalar_cast_internal.h"
#include "arrow/util/bitmap_ops.h"
#include "arrow/util/int_util.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_numeric.cc
b/cpp/src/arrow/compute/kernels/scalar_cast_numeric.cc
index 4334a39c06..a02f83351b 100644
--- a/cpp/src/arrow/compute/kernels/scalar_cast_numeric.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_cast_numeric.cc
@@ -18,7 +18,7 @@
// Implementation of casting to integer, floating point, or decimal types
#include "arrow/array/builder_primitive.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/scalar_cast_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/scalar.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_string.cc
b/cpp/src/arrow/compute/kernels/scalar_cast_string.cc
index 44e233f98c..ebeb597207 100644
--- a/cpp/src/arrow/compute/kernels/scalar_cast_string.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_cast_string.cc
@@ -21,7 +21,7 @@
#include "arrow/array/array_base.h"
#include "arrow/array/builder_binary.h"
#include "arrow/compute/kernels/codegen_internal.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/scalar_cast_internal.h"
#include "arrow/compute/kernels/temporal_internal.h"
#include "arrow/result.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc
b/cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc
index 845fad3004..375cb0a0da 100644
--- a/cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc
@@ -20,7 +20,7 @@
#include <limits>
#include "arrow/array/builder_time.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/scalar_cast_internal.h"
#include "arrow/compute/kernels/temporal_internal.h"
#include "arrow/util/bitmap_reader.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_compare.cc
b/cpp/src/arrow/compute/kernels/scalar_compare.cc
index 6ff8981588..aad648ca27 100644
--- a/cpp/src/arrow/compute/kernels/scalar_compare.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_compare.cc
@@ -21,7 +21,7 @@
#include <optional>
#include "arrow/compute/api_scalar.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/util/bit_util.h"
#include "arrow/util/bitmap_ops.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_nested.cc
b/cpp/src/arrow/compute/kernels/scalar_nested.cc
index 8d25017e40..733ab9c0dc 100644
--- a/cpp/src/arrow/compute/kernels/scalar_nested.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_nested.cc
@@ -21,7 +21,7 @@
#include "arrow/array/array_base.h"
#include "arrow/array/builder_nested.h"
#include "arrow/compute/api_scalar.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/result.h"
#include "arrow/util/bit_block_counter.h"
#include "arrow/util/bit_util.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_random.cc
b/cpp/src/arrow/compute/kernels/scalar_random.cc
index f145f6b603..608f763021 100644
--- a/cpp/src/arrow/compute/kernels/scalar_random.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_random.cc
@@ -21,7 +21,7 @@
#include "arrow/compute/api_scalar.h"
#include "arrow/compute/kernel.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/registry.h"
#include "arrow/util/pcg_random.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_round.cc
b/cpp/src/arrow/compute/kernels/scalar_round.cc
index f0ad7ea3b1..41961ad50e 100644
--- a/cpp/src/arrow/compute/kernels/scalar_round.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_round.cc
@@ -26,7 +26,7 @@
#include "arrow/compute/api_scalar.h"
#include "arrow/compute/cast.h"
#include "arrow/compute/kernels/base_arithmetic_internal.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/type.h"
#include "arrow/type_traits.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_set_lookup.cc
b/cpp/src/arrow/compute/kernels/scalar_set_lookup.cc
index 28a3b37996..c3d2bc5417 100644
--- a/cpp/src/arrow/compute/kernels/scalar_set_lookup.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_set_lookup.cc
@@ -18,7 +18,7 @@
#include "arrow/array/array_base.h"
#include "arrow/compute/api_scalar.h"
#include "arrow/compute/cast.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/util/bit_util.h"
#include "arrow/util/bitmap_writer.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_set_lookup_benchmark.cc
b/cpp/src/arrow/compute/kernels/scalar_set_lookup_benchmark.cc
index 02f6af4bee..c49dd74084 100644
--- a/cpp/src/arrow/compute/kernels/scalar_set_lookup_benchmark.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_set_lookup_benchmark.cc
@@ -18,7 +18,7 @@
#include "benchmark/benchmark.h"
#include "arrow/compute/api_scalar.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/test_util.h"
#include "arrow/testing/gtest_util.h"
#include "arrow/testing/random.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_string_internal.h
b/cpp/src/arrow/compute/kernels/scalar_string_internal.h
index 910b3dbdbd..1a99694416 100644
--- a/cpp/src/arrow/compute/kernels/scalar_string_internal.h
+++ b/cpp/src/arrow/compute/kernels/scalar_string_internal.h
@@ -20,7 +20,7 @@
#include <sstream>
#include "arrow/compute/api_scalar.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
namespace arrow {
namespace compute {
diff --git a/cpp/src/arrow/compute/kernels/scalar_temporal_binary.cc
b/cpp/src/arrow/compute/kernels/scalar_temporal_binary.cc
index 8a00aff3c2..350463ddbe 100644
--- a/cpp/src/arrow/compute/kernels/scalar_temporal_binary.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_temporal_binary.cc
@@ -21,7 +21,7 @@
#include "arrow/builder.h"
#include "arrow/compute/api_scalar.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/temporal_internal.h"
#include "arrow/util/checked_cast.h"
#include "arrow/util/time.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc
b/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc
index affdf31d2e..bc533568c4 100644
--- a/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc
@@ -21,7 +21,7 @@
#include "arrow/builder.h"
#include "arrow/compute/api_scalar.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/temporal_internal.h"
#include "arrow/util/checked_cast.h"
#include "arrow/util/time.h"
diff --git a/cpp/src/arrow/compute/kernels/scalar_validity.cc
b/cpp/src/arrow/compute/kernels/scalar_validity.cc
index e5fdb7d856..6b1cec0f5c 100644
--- a/cpp/src/arrow/compute/kernels/scalar_validity.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_validity.cc
@@ -18,7 +18,7 @@
#include <cmath>
#include "arrow/compute/api_scalar.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/util/bit_util.h"
#include "arrow/util/bitmap_ops.h"
diff --git a/cpp/src/arrow/compute/kernels/vector_array_sort.cc
b/cpp/src/arrow/compute/kernels/vector_array_sort.cc
index a9f4a084cf..ccf691669b 100644
--- a/cpp/src/arrow/compute/kernels/vector_array_sort.cc
+++ b/cpp/src/arrow/compute/kernels/vector_array_sort.cc
@@ -25,7 +25,7 @@
#include "arrow/array/data.h"
#include "arrow/compute/api_vector.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/compute/kernels/vector_sort_internal.h"
#include "arrow/type_traits.h"
diff --git a/cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc
b/cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc
index 76bda200da..91d78f690b 100644
--- a/cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc
+++ b/cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc
@@ -22,7 +22,7 @@
#include "arrow/compute/cast.h"
#include "arrow/compute/kernels/base_arithmetic_internal.h"
#include "arrow/compute/kernels/codegen_internal.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/result.h"
#include "arrow/util/bit_util.h"
#include "arrow/visit_type_inline.h"
diff --git a/cpp/src/arrow/compute/kernels/vector_hash.cc
b/cpp/src/arrow/compute/kernels/vector_hash.cc
index 5121a8d4b4..edc6b0df13 100644
--- a/cpp/src/arrow/compute/kernels/vector_hash.cc
+++ b/cpp/src/arrow/compute/kernels/vector_hash.cc
@@ -27,7 +27,7 @@
#include "arrow/array/dict_internal.h"
#include "arrow/array/util.h"
#include "arrow/compute/api_vector.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/result.h"
#include "arrow/util/hashing.h"
diff --git a/cpp/src/arrow/compute/kernels/vector_nested.cc
b/cpp/src/arrow/compute/kernels/vector_nested.cc
index 1a17d551ec..08930e589f 100644
--- a/cpp/src/arrow/compute/kernels/vector_nested.cc
+++ b/cpp/src/arrow/compute/kernels/vector_nested.cc
@@ -18,7 +18,7 @@
// Vector kernels involving nested types
#include "arrow/array/array_base.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/result.h"
#include "arrow/visit_type_inline.h"
diff --git a/cpp/src/arrow/compute/kernels/vector_replace.cc
b/cpp/src/arrow/compute/kernels/vector_replace.cc
index 25c6e5947d..35448b9595 100644
--- a/cpp/src/arrow/compute/kernels/vector_replace.cc
+++ b/cpp/src/arrow/compute/kernels/vector_replace.cc
@@ -16,7 +16,7 @@
// under the License.
#include "arrow/compute/api_scalar.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/copy_data_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/util/bitmap_ops.h"
diff --git a/cpp/src/arrow/compute/kernels/vector_selection.cc
b/cpp/src/arrow/compute/kernels/vector_selection.cc
index 5060b06465..f1b09583de 100644
--- a/cpp/src/arrow/compute/kernels/vector_selection.cc
+++ b/cpp/src/arrow/compute/kernels/vector_selection.cc
@@ -30,7 +30,7 @@
#include "arrow/buffer_builder.h"
#include "arrow/chunked_array.h"
#include "arrow/compute/api_vector.h"
-#include "arrow/compute/kernels/common.h"
+#include "arrow/compute/kernels/common_internal.h"
#include "arrow/compute/kernels/util_internal.h"
#include "arrow/extension_type.h"
#include "arrow/record_batch.h"
diff --git a/cpp/src/arrow/compute/row/grouper.cc
b/cpp/src/arrow/compute/row/grouper.cc
index cf0aa7dd49..d003137d3e 100644
--- a/cpp/src/arrow/compute/row/grouper.cc
+++ b/cpp/src/arrow/compute/row/grouper.cc
@@ -25,7 +25,7 @@
#include "arrow/compute/exec/options.h"
#include "arrow/compute/exec_internal.h"
#include "arrow/compute/function.h"
-#include "arrow/compute/kernels/row_encoder.h"
+#include "arrow/compute/kernels/row_encoder_internal.h"
#include "arrow/compute/light_array.h"
#include "arrow/compute/registry.h"
#include "arrow/compute/row/compare_internal.h"
diff --git a/cpp/src/arrow/dataset/dataset_test.cc
b/cpp/src/arrow/dataset/dataset_test.cc
index 5d19982347..eb3fd0e304 100644
--- a/cpp/src/arrow/dataset/dataset_test.cc
+++ b/cpp/src/arrow/dataset/dataset_test.cc
@@ -22,7 +22,7 @@
#include "arrow/dataset/dataset_internal.h"
#include "arrow/dataset/discovery.h"
#include "arrow/dataset/partition.h"
-#include "arrow/dataset/test_util.h"
+#include "arrow/dataset/test_util_internal.h"
#include "arrow/filesystem/mockfs.h"
#include "arrow/stl.h"
#include "arrow/testing/generator.h"
diff --git a/cpp/src/arrow/dataset/discovery_test.cc
b/cpp/src/arrow/dataset/discovery_test.cc
index 4ca98baf39..5b0590a277 100644
--- a/cpp/src/arrow/dataset/discovery_test.cc
+++ b/cpp/src/arrow/dataset/discovery_test.cc
@@ -24,7 +24,7 @@
#include <utility>
#include "arrow/dataset/partition.h"
-#include "arrow/dataset/test_util.h"
+#include "arrow/dataset/test_util_internal.h"
#include "arrow/filesystem/test_util.h"
#include "arrow/testing/gtest_util.h"
#include "arrow/type_fwd.h"
diff --git a/cpp/src/arrow/dataset/file_csv_test.cc
b/cpp/src/arrow/dataset/file_csv_test.cc
index 23c8a1bb56..7ee2a48d0d 100644
--- a/cpp/src/arrow/dataset/file_csv_test.cc
+++ b/cpp/src/arrow/dataset/file_csv_test.cc
@@ -26,7 +26,7 @@
#include "arrow/dataset/file_base.h"
#include "arrow/dataset/partition.h"
#include "arrow/dataset/plan.h"
-#include "arrow/dataset/test_util.h"
+#include "arrow/dataset/test_util_internal.h"
#include "arrow/filesystem/mockfs.h"
#include "arrow/io/compressed.h"
#include "arrow/io/memory.h"
diff --git a/cpp/src/arrow/dataset/file_ipc_test.cc
b/cpp/src/arrow/dataset/file_ipc_test.cc
index 205d3b8123..370c6d9782 100644
--- a/cpp/src/arrow/dataset/file_ipc_test.cc
+++ b/cpp/src/arrow/dataset/file_ipc_test.cc
@@ -25,7 +25,7 @@
#include "arrow/dataset/discovery.h"
#include "arrow/dataset/file_base.h"
#include "arrow/dataset/partition.h"
-#include "arrow/dataset/test_util.h"
+#include "arrow/dataset/test_util_internal.h"
#include "arrow/io/memory.h"
#include "arrow/ipc/reader.h"
#include "arrow/ipc/writer.h"
diff --git a/cpp/src/arrow/dataset/file_orc_test.cc
b/cpp/src/arrow/dataset/file_orc_test.cc
index ddda76b197..17be015de5 100644
--- a/cpp/src/arrow/dataset/file_orc_test.cc
+++ b/cpp/src/arrow/dataset/file_orc_test.cc
@@ -25,7 +25,7 @@
#include "arrow/dataset/discovery.h"
#include "arrow/dataset/file_base.h"
#include "arrow/dataset/partition.h"
-#include "arrow/dataset/test_util.h"
+#include "arrow/dataset/test_util_internal.h"
#include "arrow/io/memory.h"
#include "arrow/record_batch.h"
#include "arrow/table.h"
diff --git a/cpp/src/arrow/dataset/file_parquet_test.cc
b/cpp/src/arrow/dataset/file_parquet_test.cc
index ed495366ac..1d2febf0fe 100644
--- a/cpp/src/arrow/dataset/file_parquet_test.cc
+++ b/cpp/src/arrow/dataset/file_parquet_test.cc
@@ -23,7 +23,7 @@
#include "arrow/compute/api_scalar.h"
#include "arrow/dataset/dataset_internal.h"
-#include "arrow/dataset/test_util.h"
+#include "arrow/dataset/test_util_internal.h"
#include "arrow/io/memory.h"
#include "arrow/io/util_internal.h"
#include "arrow/record_batch.h"
diff --git a/cpp/src/arrow/dataset/file_test.cc
b/cpp/src/arrow/dataset/file_test.cc
index 4c00c95661..914bfa28b5 100644
--- a/cpp/src/arrow/dataset/file_test.cc
+++ b/cpp/src/arrow/dataset/file_test.cc
@@ -29,7 +29,7 @@
#include "arrow/dataset/api.h"
#include "arrow/dataset/partition.h"
#include "arrow/dataset/plan.h"
-#include "arrow/dataset/test_util.h"
+#include "arrow/dataset/test_util_internal.h"
#include "arrow/filesystem/path_util.h"
#include "arrow/filesystem/test_util.h"
#include "arrow/status.h"
diff --git a/cpp/src/arrow/dataset/partition_test.cc
b/cpp/src/arrow/dataset/partition_test.cc
index 69402816f3..3e681a9cb7 100644
--- a/cpp/src/arrow/dataset/partition_test.cc
+++ b/cpp/src/arrow/dataset/partition_test.cc
@@ -30,7 +30,7 @@
#include "arrow/compute/api_vector.h"
#include "arrow/dataset/dataset.h"
#include "arrow/dataset/file_ipc.h"
-#include "arrow/dataset/test_util.h"
+#include "arrow/dataset/test_util_internal.h"
#include "arrow/filesystem/path_util.h"
#include "arrow/status.h"
#include "arrow/testing/builder.h"
diff --git a/cpp/src/arrow/dataset/scan_node.cc
b/cpp/src/arrow/dataset/scan_node.cc
index 15b82fb076..0b1b6d03b4 100644
--- a/cpp/src/arrow/dataset/scan_node.cc
+++ b/cpp/src/arrow/dataset/scan_node.cc
@@ -114,11 +114,13 @@ Future<AsyncGenerator<std::shared_ptr<Fragment>>>
GetFragments(Dataset* dataset,
/// fragments. On destruction we continue consuming the fragments until they
complete
/// (which should be fairly quick since we cancelled the fragment). This
ensures the
/// I/O work is completely finished before the node is destroyed.
-class ScanNode : public cp::ExecNode, public cp::TracedNode<ScanNode> {
+class ScanNode : public cp::ExecNode, public cp::TracedNode {
public:
ScanNode(cp::ExecPlan* plan, ScanV2Options options,
std::shared_ptr<Schema> output_schema)
- : cp::ExecNode(plan, {}, {}, std::move(output_schema)),
options_(options) {}
+ : cp::ExecNode(plan, {}, {}, std::move(output_schema)),
+ cp::TracedNode(this),
+ options_(options) {}
static Result<ScanV2Options> NormalizeAndValidate(const ScanV2Options&
options,
compute::ExecContext* ctx)
{
diff --git a/cpp/src/arrow/dataset/scanner_benchmark.cc
b/cpp/src/arrow/dataset/scanner_benchmark.cc
index 448082feb9..2ad934d9a6 100644
--- a/cpp/src/arrow/dataset/scanner_benchmark.cc
+++ b/cpp/src/arrow/dataset/scanner_benchmark.cc
@@ -24,7 +24,7 @@
#include "arrow/dataset/dataset.h"
#include "arrow/dataset/plan.h"
#include "arrow/dataset/scanner.h"
-#include "arrow/dataset/test_util.h"
+#include "arrow/dataset/test_util_internal.h"
#include "arrow/testing/gtest_util.h"
#include "arrow/testing/matchers.h"
#include "arrow/testing/random.h"
diff --git a/cpp/src/arrow/dataset/scanner_test.cc
b/cpp/src/arrow/dataset/scanner_test.cc
index 89f2d1e219..f98cdb98da 100644
--- a/cpp/src/arrow/dataset/scanner_test.cc
+++ b/cpp/src/arrow/dataset/scanner_test.cc
@@ -32,7 +32,7 @@
#include "arrow/compute/exec/test_util.h"
#include "arrow/dataset/dataset_internal.h"
#include "arrow/dataset/plan.h"
-#include "arrow/dataset/test_util.h"
+#include "arrow/dataset/test_util_internal.h"
#include "arrow/record_batch.h"
#include "arrow/table.h"
#include "arrow/testing/async_test_util.h"
diff --git a/cpp/src/arrow/dataset/test_util.h
b/cpp/src/arrow/dataset/test_util_internal.h
similarity index 100%
rename from cpp/src/arrow/dataset/test_util.h
rename to cpp/src/arrow/dataset/test_util_internal.h
diff --git a/cpp/src/arrow/util/type_fwd.h b/cpp/src/arrow/util/type_fwd.h
index 76e685ffa6..6d904f19b1 100644
--- a/cpp/src/arrow/util/type_fwd.h
+++ b/cpp/src/arrow/util/type_fwd.h
@@ -36,6 +36,11 @@ class TaskGroup;
class ThreadPool;
class CpuInfo;
+namespace tracing {
+
+struct Scope;
+
+} // namespace tracing
} // namespace internal
struct Compression {