Skip to content

GH-55455: [C++] Make level comparison header internal - #55456

Open
09Catho wants to merge 2 commits into
apache:mainfrom
09Catho:fix/internal-level-comparison-header
Open

09Catho wants to merge 2 commits into
apache:mainfrom
09Catho:fix/internal-level-comparison-header

Conversation

@09Catho

@09Catho 09Catho commented Nov 9, 2026 •

Copy link
Copy Markdown

Rationale for this change

parquet/level_comparison.h is only included by Parquet implementation files, but Meson installs it with the public Parquet headers. Renaming it as an internal header makes that boundary explicit and prevents it from being treated as public API.

What changes are included in this PR?

  • Rename level_comparison.h to level_comparison_internal.h.
  • Update the eight internal include sites.
  • Remove the header from Meson's installed-header list.
  • Rename level_comparison_inc.h and level_conversion_inc.h to level_comparison_inc_internal.h and level_conversion_inc_internal.h, and drop them from Meson's installed-header list. Both include level_comparison_internal.h, so installing them would ship headers with a missing include.

This addresses #55455 without changing runtime behavior.

Are these changes tested?

  • git diff --check passed.
  • Repository-wide search found no remaining parquet/level_comparison.h include or install reference.
  • g++ 13.2 -fsyntax-only compiles level_comparison.cc, level_conversion.cc, and level_conversion_bmi2.cc (BMI2 flags for the last one).
  • A script applying the ARROW_INSTALL_ALL_HEADERS filter to cpp/src/parquet finds no installed header including an uninstalled parquet/ header, apart from the generated parquet_version.h (same as main).
  • pre-commit cpp hooks pass on the changed files.
  • A narrow CMake configure reached Arrow's bundled Boost dependency setup, but could not complete within the local validation window; no C++ build result is claimed.

Are there any user-facing changes?

level_comparison.h, level_comparison_inc.h, and level_conversion_inc.h are no longer installed as public Parquet headers. No runtime behavior changes.

Was AI used for this PR?

In accordance with the Arrow AI-generation guidance:

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

Codex was used to inspect the issue, implement the scoped rename, and prepare this description. The complete diff was reviewed in this run, and the validation limits are stated above.

Copilot AI balanced review requested due to automatic review settings November 9, 2026 15:29

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

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

Comment thread cpp/src/parquet/meson.build Outdated
'hasher.h',
'index_location.h',
'level_comparison.h',
'level_comparison_inc.h',

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.

I'm a little bit curious why level_comparison_inc.h is listed here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It was already in the install list and I only removed the renamed header. But this points at a real problem with the change. level_comparison_inc.h and level_conversion_inc.h are only included from level_comparison.cc, level_conversion.cc and level_conversion_bmi2.cc, yet both still get installed: Meson lists them, and CMake's ARROW_INSTALL_ALL_HEADERS installs any header without "internal" in its name. After this PR both include parquet/level_comparison_internal.h, which is no longer installed, so the installed copies would include a header that isn't there.

I can give both an _internal name as well and drop them from the Meson list. Should I do that here, or keep this PR to level_comparison.h and open a follow-up?

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.

@pitrou Let's mark both of them to internal and removing from exporting?

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.

Just edit them is ok, after check, they're still "internal"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done in 623bae9. Both are renamed to level_comparison_inc_internal.h and level_conversion_inc_internal.h. I updated the three .cc files that include them and the BMI2 comment in CMakeLists.txt, and removed them from Meson's install_headers list. CMake's ARROW_INSTALL_ALL_HEADERS already skips anything with "internal" in the name, so neither gets installed now.

Checked locally:

  • g++ 13.2 -fsyntax-only compiles level_comparison.cc, level_conversion.cc, and level_conversion_bmi2.cc (the last with -mavx2 -mbmi2 -DARROW_HAVE_BMI2).
  • A small script that applies the ARROW_INSTALL_ALL_HEADERS filter to cpp/src/parquet and checks each installed header's parquet/ includes. On b95f08a it reports both _inc.h headers pointing at the uninstalled level_comparison_internal.h. With this commit the only hit is the generated parquet_version.h, same as main.
  • pre-commit cpp hooks (clang-format, cpplint, cmake-format, meson) pass on the changed files.

I still haven't run a full C++ build or the tests.

@mapleFU

mapleFU commented Nov 9, 2026

Copy link
Copy Markdown
Member

General LGTM

Copilot AI balanced review requested due to automatic review settings November 18, 2026 10:50

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants