Skip to content

GH-47576: [C++][Acero] Fix C++23 build - #50975

Merged
kou merged 1 commit into
apache:mainfrom
jmcarcell:gh-47207-cxx23-asof-join
Oct 30, 2026
Merged

kou merged 1 commit into
apache:mainfrom
jmcarcell:gh-47207-cxx23-asof-join

Conversation

@jmcarcell

@jmcarcell jmcarcell commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Rationale for this change

In C++23, Clang diagnoses the conversion from AsofJoinNode* to ExecNode*
while instantiating std::make_unique<BackpressureController>. At the current
definition site, AsofJoinNode is still incomplete, causing the Acero build to
fail.

What changes are included in this PR?

Declare InputState::Make in InputState and define it after AsofJoinNode is
complete. This makes the derived-to-base conversion valid without changing runtime
behavior.

AI assistance: Codex drafted and evaluated this source-ordering change. The
automated checks below were run before opening the PR.

Are these changes tested?

  • cmake --build cpp/build-clang22-cxx23-release --target arrow_acero_static --parallel 2
    (Clang 22.1.8, Release, C++23)
  • ctest -j 16 --output-on-failure in
    cpp/build-clang22-cxx23-release-tests/src/arrow/acero: 14/14 tests passed
  • clang-format --dry-run --Werror cpp/src/arrow/acero/asof_join_node.cc
  • git diff --check
Original `Clang 22` `C++23` diagnostic
In file included from /arrow/src/arrow/acero/asof_join_node.cc:18:
In file included from /arrow/src/arrow/acero/asof_join_node.h:20:
In file included from /arrow/src/arrow/acero/options.h:21:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/16/../../../../include/c++/16/memory:80:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/16/../../../../include/c++/16/bits/unique_ptr.h:1105:34: error: no matching constructor for initialization of 'arrow::acero::BackpressureController'
 1105 |     { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
      |                                  ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/arrow/src/arrow/acero/asof_join_node.cc:515:14: note: in instantiation of function template specialization 'std::make_unique<arrow::acero::BackpressureController, arrow::acero::ExecNode *&, arrow::acero::AsofJoinNode *&, std::atomic<int> &>' requested here
  515 |         std::make_unique<BackpressureController>(
      |              ^
/arrow/src/arrow/acero/asof_join_node.cc:464:3: note: candidate constructor not viable: cannot convert argument of incomplete type 'arrow::acero::AsofJoinNode *' to 'ExecNode *' for 2nd argument
  464 |   BackpressureController(ExecNode* node, ExecNode* output,
      |   ^                                      ~~~~~~~~~~~~~~~~
/arrow/src/arrow/acero/asof_join_node.cc:462:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3 were provided
  462 | class BackpressureController : public BackpressureControl {
      |       ^~~~~~~~~~~~~~~~~~~~~~
/arrow/src/arrow/acero/asof_join_node.cc:462:7: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 3 were provided
  462 | class BackpressureController : public BackpressureControl {
      |       ^~~~~~~~~~~~~~~~~~~~~~
/arrow/src/arrow/acero/asof_join_node.cc:794:17: warning: private field 'node_' is not used [-Wunused-private-field]
  794 |   AsofJoinNode* node_;
      |                 ^
/arrow/src/arrow/acero/asof_join_node.cc:796:10: warning: private field 'index_' is not used [-Wunused-private-field]
  796 |   size_t index_;
      |          ^
2 warnings and 1 error generated.

Are there any user-facing changes?

No public API changes. This restores the ability to compile the Acero component
with the affected Clang 22/C++23 configuration.

Copilot AI lite review requested due to automatic review settings August 24, 2026 17:29
@github-actions github-actions Bot added the awaiting review Awaiting review label Aug 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts function definition ordering in Acero’s AsofJoinNode implementation to satisfy stricter C++23 type-completeness requirements when constructing backpressure control (resolving a C++23 build failure referenced by GH-47207).

Changes:

  • Moves InputState::Make from an in-class definition to an out-of-line definition placed after AsofJoinNode is fully defined.
  • Preserves existing backpressure controller/handler setup logic while enabling C++23 to perform the AsofJoinNode* → ExecNode* conversion during BackpressureController construction.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jmcarcell jmcarcell changed the title GH-47207: [C++] Fix C++23 Acero build GH-47576: [C++][Acero] Fix C++23 build Aug 24, 2026
@jmcarcell jmcarcell changed the title GH-47576: [C++][Acero] Fix C++23 build GH-47207: [C++][Acero] Fix C++23 Acero build Aug 24, 2026
@jmcarcell jmcarcell changed the title GH-47207: [C++][Acero] Fix C++23 Acero build GH-47576: [C++][Acero] Fix C++23 build Aug 24, 2026
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #47576 has been automatically assigned in GitHub to PR creator.

2 similar comments
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #47576 has been automatically assigned in GitHub to PR creator.

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #47576 has been automatically assigned in GitHub to PR creator.

@jmcarcell

Copy link
Copy Markdown
Contributor Author

The build error seems unrelated, with lots of HTTP errors. And the pre-commit one I don't understand it, also seems unrelated and I'm not changing any python code.

@kou

kou commented Oct 30, 2026

Copy link
Copy Markdown
Member

Could you rebase on main?

@kou kou added the CI: Extra: C++ Run extra C++ CI label Oct 30, 2026
@jmcarcell
jmcarcell force-pushed the gh-47207-cxx23-asof-join branch from ac311f0 to dc4268c Compare October 30, 2026 06:54
Copilot AI lite review requested due to automatic review settings October 30, 2026 06:54
@jmcarcell

Copy link
Copy Markdown
Contributor Author

Done

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The reviewed change resolves the Clang C++23 incomplete-type conversion by defining InputState::Make after AsofJoinNode is complete while preserving existing behavior and public APIs.

No open issues 🎉

Review effort: Lite

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #47576 has been automatically assigned in GitHub to PR creator.

@kou
kou merged commit 3f1fd72 into apache:main Oct 30, 2026
69 of 72 checks passed
@kou kou removed the awaiting review Awaiting review label Oct 30, 2026
@github-actions github-actions Bot added the awaiting merge Awaiting merge label Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants