Skip to content

MINOR: [C++][Parquet] Clean up chunker test assertions - #55637

Merged
wgtmac merged 1 commit into
apache:mainfrom
Sumdiboii:fix/parquet-chunker-test-cleanups
Nov 17, 2026
Merged

wgtmac merged 1 commit into
apache:mainfrom
Sumdiboii:fix/parquet-chunker-test-cleanups

Conversation

@Sumdiboii

@Sumdiboii Sumdiboii commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Rationale for this change

I have been studying the Apache Arrow codebase for the past couple of weeks and am still relatively new to open source. I had my first documentation fix merged a couple of days ago, and while continuing to read through the C++ and Parquet code, I noticed a few small cleanup opportunities in the content-defined chunking tests and related documentation comments.

These changes are intentionally small and do not alter production behavior. They improve readability, remove an unnecessary copy, and clean up an accidental duplicate assertion.

What changes are included in this PR?

  • Fix four spelling errors in C++ comments:

    • preceeding to preceding
    • specifed to specified
    • determinisic to deterministic
    • lenght to length
  • Replace diffs.size() == 0 with diffs.empty() in the page-length assertion helpers. This expresses the intent more directly and is the idiomatic way to check whether a container has no elements.

  • Remove a duplicated dictionary-page assertion in AssertContentDefinedChunkSizes.

    The duplicate initially caught my attention because I was unsure whether the two identical assertions were intended as some kind of additional failure protection. After looking into the helper's callers, the original commit, and GoogleTest's assertion behavior, I found that both assertions checked exactly the same condition. Since ASSERT_EQ is fatal and returns from the helper when it fails, the second assertion would never run after a failure in the first one. When the first assertion passes, the second one does not provide any additional coverage, so it was redundant.

  • Change the local page_lengths variable to a const reference to avoid copying the page-length vector unnecessarily.

Are these changes tested?

No runtime tests were run. The changes are limited to comments and small test-code cleanups, with no production behavior or public API changes.

git diff --check was run successfully though. A focused C++ test build was not available in the checkout, so the Parquet test suite was not run locally.

Are there any user-facing changes?

No. These are test and comment cleanups only.

Was AI used for this PR?

AI was used to help search through the codebase, investigate the history and behavior of the duplicated assertion, and review the proposed small cleanup changes. The changes and reasoning were all reviewed before submission.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

Note - The duplicated assertion seemed redundant based on the current helper behavior and GoogleTest's fatal assertion semantics. If it was originally intended to serve a purpose that I have overlooked, please let me know and I would be happy to revise my change.

Fix spelling errors, remove a duplicate dictionary-page assertion, use empty() for empty diff checks, and avoid copying page-length metadata in the content-defined chunking tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 15:35

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.

@Sumdiboii
Sumdiboii requested a lite review from Copilot November 16, 2026 15:36

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

1 open issue

Review effort: Lite

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

No open issues 🎉

1 resolved since last review

Review effort: Lite

@Sumdiboii

Copy link
Copy Markdown
Contributor Author

The three failing checks seem unrelated to this PR

@wgtmac
wgtmac merged commit fae4262 into apache:main Nov 17, 2026
57 of 60 checks passed
@wgtmac

wgtmac commented Nov 17, 2026

Copy link
Copy Markdown
Member

Thanks @Sumdiboii!

@Sumdiboii
Sumdiboii deleted the fix/parquet-chunker-test-cleanups branch November 17, 2026 08:05
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