Skip to content

GH-55307: [C++][Parquet] Minor/optimize write level counting - #55308

Open
mapleFU wants to merge 4 commits into
apache:mainfrom
mapleFU:minor/optimize-write-level-count
Open

mapleFU wants to merge 4 commits into
apache:mainfrom
mapleFU:minor/optimize-write-level-count

Conversation

@mapleFU

@mapleFU mapleFU commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Rationale for this change

Optimize level counting in parquet column writer.

See: https://godbolt.org/z/qhEGa418x

What changes are included in this PR?

Some naive changes, this separate some dependencies, thus the code would be easy to vectorize.

Are these changes tested?

Covered by existing

Are there any user-facing changes?

No

Was AI used for this PR?

PR code and description written by:

  • Human

Reviewed before submission by:

  • Human
  • AI

Copilot AI balanced review requested due to automatic review settings October 29, 2026 05:19
@github-actions

Copy link
Copy Markdown

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

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.

🟡 Changes recommended

The newly cached level variables remain unused, causing warnings that break compilation under Arrow’s CHECKIN debug configuration with -Wall -Werror.

1 open issue
What changed in this PR

This PR optimizes level counting in the C++ Parquet column writer to make the counting loops easier to vectorize, with no intended user-facing changes.

Changes:

  • Replace repeated-row counting loops with std::count.
  • Accumulate definition-level counts locally before updating output parameters.
File Description
cpp/​src/​parquet/​column_writer.cc Optimize repetition- and definition-level counting in the writer.

Review effort: Balanced

Comment thread cpp/src/parquet/column_writer.cc Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 05:41

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

No active review issues are reported for the column writer’s level-counting changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Comment thread cpp/src/parquet/column_writer.cc Outdated
Copilot AI balanced review requested due to automatic review settings October 29, 2026 05:56
@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Oct 29, 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.

🟢 Approval recommended

No active review issues were identified for the Parquet level-counting optimization.

No open issues 🎉

Review effort: Balanced

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.

3 participants