Skip to content

fix(cpp): reject reader options that are not key=value - #942

Merged
yihua merged 2 commits into
apache:mainfrom
codope:cpp/strict-reader-options
Nov 8, 2026
Merged

yihua merged 2 commits into
apache:mainfrom
codope:cpp/strict-reader-options

Conversation

@codope

@codope codope commented Oct 30, 2026

Copy link
Copy Markdown
Member

Description

new_file_group_reader_with_options dropped any option without =, so a C++ caller who wrote hoodie.read.use.read_optimized.mode without a value, or mistyped the separator, got a reader that silently ignored the option. It now throws rust::Error naming the malformed option; the header doc says so.

Behavior change for C++ callers: an option without = used to be dropped and is now an error. Split out of #767 at review so it shows up on its own in the release notes.

Values may contain =: only the first one splits (b=x=y → ("b", "x=y")).

How are the changes test-covered

  • N/A
  • Automated tests (unit and/or integration tests)
  • Manual tests
    • Details are described below

Unit test on the key=value parser the constructor uses (malformed option is an error; a value containing = keeps it). The constructor itself can't be handed such an option from a Rust test, because CxxVector<CxxString> cannot be filled from Rust.

new_file_group_reader_with_options dropped any option without '=', so a
C++ caller who wrote "hoodie.read.use.read_optimized.mode" without a
value, or mistyped the separator, got a reader that silently ignored the
option. Return an error naming the malformed option instead.

This is a behavior change for C++ callers that relied on the drop.

Signed-off-by: codope <sagarsumit09@gmail.com>
@codope
codope force-pushed the cpp/strict-reader-options branch from bc81f62 to cedbc09 Compare October 30, 2026 18:57
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.96%. Comparing base (537b8f8) to head (dd4e88a).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #942      +/-   ##
==========================================
- Coverage   90.97%   90.96%   -0.01%     
==========================================
  Files         154      154              
  Lines       22078    22069       -9     
==========================================
- Hits        20085    20075      -10     
- Misses       1993     1994       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The doc comment on test_key_values_option_without_equals_is_error now
describes what the test holds (an option without `=` is an error, and
only the first `=` splits) instead of what the constructor did before.
@yihua

yihua commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for the contribution! LGTM, with a minor revision pushed in the latest commit that rewords the key_values test doc to state the parsing rule as it stands.

@yihua
yihua enabled auto-merge (squash) November 8, 2026 05:00
@yihua
yihua merged commit 0ff3d61 into apache:main Nov 8, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants