Repository navigation
Conversation
…actly Pins the planner commit that adds ExactKind::SumOfSquaredDeviations (a standard deviation's or variance's count, mean and sum of squared deviations, 24-byte view record) and gives its state columns a compact form: CompactKind::SumOfSquaredDeviations (code 7), an all-zero empty record as one tag byte, otherwise the count as a varint and the mean and sum as floats; any other record is kept whole. Decoding rebuilds the view bytes exactly. Serde-persisted exact states need no change (the new ScalarState variant round-trips). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
…nullable) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ExactKind::SumOfSquaredDeviations, ASAPPlanner #1560). The data plane's compact state-column codec has no form for it, andcompact_kind's exhaustive match stops compiling against that planner.71137c21, #1560 head). AddCompactKind::SumOfSquaredDeviations(code 7): an all-zero empty record is one tag byte; otherwise the record is a tag, the count as a varint, and the mean and sum of squared deviations as floats.stddev_over_time(x[1h])kept at ingestion) persists and reads back cold byte for byte. A 3-value record takes 1 tag byte + a 1-byte varint + 2 floats, instead of a 24-byte raw record.Review guide
feat/raw-read-label-pushdown(feat(data_plane): raw reads return only the series a Scan's label predicates select #902). Small draft stacked on it.data_plane/src/state_codec.rs(put_record,record, new test) and the one new arm indata_plane/src/segment.rscompact_kind.Cargo.toml,data_plane/Cargo.tomlandCargo.lock(same base commit b9c7fdfa plus the planner PR).Behavior: before → after
The planner selects
SummaryTumblingWindowChain[SumOfSquaredDeviations]forstddev_over_time(data[1h]).compact_kindis a non-exhaustive match).count u64, mean f64, sum_squared_deviations f64).StoredValue::Exact) need no change: the newScalarStatevariant round-trips through rmp-serde.Interfaces
data_plane/src/state_codec.rs/// State families with a compact form. The type stays; one variant added. pub enum CompactKind { DDSketch, Sum, Count, MinMax, Counter, LastTwoSamples, + /// Exact sum of squared deviations: `count` (u64), `mean`, `sum_squared_deviations` + /// (f64); an empty one is all zero. Column-descriptor code 7. + SumOfSquaredDeviations, }On-disk format: column-descriptor code 7. Per record, tag 0 means the empty record. Tag 1 is followed by a uvarint count in the int stream, the mean in float stream 0, and the sum in float stream 1. A record in any other form keeps the existing RAW tag.
Algorithm changes
None. The codec is lossless and reuses the existing per-record framing.
Decisions and open questions
None.
Verification
cargo fmt --all --checkcargo clippy -p data_plane --all-targets -D warningscargo test -p data_plane --lib state_codeccompact_sum_of_squared_deviations_columns_rebuild_the_records: covers empty, 3-value, mean 1e9, NaN, and non-writer records (the last kept whole); checks the code round-tripscargo test -p data_plane --lib segmentFollow-ups
🤖 Generated with Claude Code
https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi