Skip to content

fix: reject invalid HLL precision and Min/Max subtype - #715

Merged
milindsrivastava1997 merged 2 commits into
mainfrom
674-reject-aggregation-parameters-that-silently-fall-back-or-change-semantics
Sep 5, 2026
Merged

fix: reject invalid HLL precision and Min/Max subtype#715
milindsrivastava1997 merged 2 commits into
mainfrom
674-reject-aggregation-parameters-that-silently-fall-back-or-change-semantics

Conversation

@milindsrivastava1997

Copy link
Copy Markdown
Contributor

Summary

  • HLL precision is now a required parameter, validated to be an integer in the 4..=18 range — previously an out-of-range or missing value silently clamped to the default (14) with only a log warning.
  • MinMax/MultipleMinMax aggregation_sub_type must now case-insensitively be "min" or "max" — previously any unrecognized value (e.g. a typo like "Mxa") silently resolved to "min".
  • Both checks live in AggregationConfig::validate() alongside the existing count_events check, following the same missing/invalid/misplaced error pattern.

Closes #674 (the count_events and SingleSubpopulation/MultipleSubpopulation subtype cases in that issue were already fixed in earlier PRs).

Test plan

  • cargo test --workspace passes (7 new regression tests in streaming_config.rs, plus fixes to 4 pre-existing tests whose HLL fixtures relied on the old silent-default behavior)
  • cargo clippy --workspace --all-targets clean
  • cargo fmt --check clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01EKLkjdnGmsFyuFqWueW2Fx

…x subtype

HLL precision out-of-range/non-numeric values silently clamped to the
default (14) instead of erroring, and unrecognized Min/Max subtypes
silently resolved to Min. Both let a config typo change aggregation
semantics without failing loudly (#674).

precision is now a required, range-checked HLL parameter, and
MinMax/MultipleMinMax subtypes must case-insensitively be "min" or
"max" — both enforced in AggregationConfig::validate() alongside the
existing count_events check.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EKLkjdnGmsFyuFqWueW2Fx
…ty matching

validate() accepts "MAX" (case-insensitive), but capability matching
compared aggregation_sub_type to the lowercase "min"/"max" constants
with exact equality — an accepted-but-uppercase config would silently
never match a query, becoming dead weight. Align the comparison with
the case-insensitive check already used for plain-CMS subtypes and
validate() itself.

Found by roborev (job 194) reviewing PR #715.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EKLkjdnGmsFyuFqWueW2Fx
@milindsrivastava1997
milindsrivastava1997 marked this pull request as ready for review September 5, 2026 01:37
@milindsrivastava1997
milindsrivastava1997 merged commit 0b5309c into main Sep 5, 2026
17 checks passed
@milindsrivastava1997
milindsrivastava1997 deleted the 674-reject-aggregation-parameters-that-silently-fall-back-or-change-semantics branch September 5, 2026 01:38
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.

Reject aggregation parameters that silently fall back or change semantics

1 participant