docs(rfc): draft RFC 0042 — typed numeric promotion (RFC 0022 amendment) - #647
Conversation
Enacts RFC 0022 §7.1, whose deferral clause ("deferred until a
consumer demands it") is now met: the FinOps loop's headline query is
sum(attr.cost_usd) by attr.model, and cost_usd arrives as a double
AnyValue, which §3.1 projects as NULL. Found via review on #646 — the
config-only promotion would have made an always-NULL column and a
silently empty sum.
Two classes (i64, f64) as per-key type declarations; f64 widens ints,
nothing parses strings; the cross-file re-typing conflict resolves by
the same rule §3.3 gives pre-amendment files (mismatched column reads
as absent, via the schema-adapter seam, no coercion); float equality
is typed-arm-only because JSON has no canonical float text; aggregates
read the typed column cast-free; an all-NULL group sums to NULL, never
a fabricated zero cost.
Nine §5 criteria incl. projection totality by proptest over AnyValue
variants x classes, the three-file absent/mismatched scan, compaction
re-projection across a re-typing, and the dogfood consumer query as
the corpus gate.
Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a drafted design RFC that amends RFC 0022 to support promoting numeric OTLP attributes into typed Parquet columns, primarily to enable correct/prunable numeric predicates and cast-free scalar aggregation (e.g., sum(attr.cost_usd) by attr.model). Updates the mdBook SUMMARY so the new RFC is discoverable in the documentation set.
Changes:
- Add RFC 0042 describing per-key typed promotion (
i64/f64) alongside existing string promotion, including conflict handling for re-typing across files. - Document predicate compilation rules and aggregation semantics for typed columns, plus acceptance criteria and testing strategy.
- Register the new RFC in
docs/SUMMARY.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/SUMMARY.md | Adds a navigation entry for RFC 0042 in the RFC list. |
| docs/rfcs/0042-typed-numeric-promotion.md | Introduces drafted RFC 0042 specifying typed numeric attribute promotion as an RFC 0022 amendment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… title Seven bare §-references read as self-references where the referent is RFC 0022 (or, in one case, genuinely this RFC); each now names its document. SUMMARY link text matches the RFC title per the convention of dropping only the amendment parenthetical. Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
Why
Enacts RFC 0022 §7.1, whose deferral clause — "deferred until a consumer demands it" — has been met. The FinOps loop's headline query is
sum(attr.cost_usd) by attr.model;cost_usdarrives as a doubleAnyValue, and RFC 0022 §3.1 pins promotion to string values only, projecting everything else asNULL.Found the honest way: #646 (now drafted, blocked on this RFC) promoted the key config-only, and review caught that the result would be an always-NULL column with
sumsilently returning empty — strictly worse than today's loud promotion-hint error.Design in one breath
Per-key type declarations —
- { key: cost_usd, type: f64 }— producingOPTIONALInt64/Float64columns under the same DSL-path names, with numeric min/max pruning for ordering and cast-free RFC0002.17 aggregation. Bare-string entries stay byte-for-byte RFC 0022.The load-bearing calls, each with its §-reference:
f64widens ints;i64never narrows doubles0vs0.0; no silent truncationUtf8in old files,Int64now)==is typed-arm-onlysumover an all-NULL group returnsNULL, not0Scope boundary carried in §2
Maintainer direction (this session): the source computes cost, Ourios stores/attributes/aggregates it, consumers own pricing tables and FOCUS-shaped output. Typed promotion is deliberately the whole of Ourios's share.
Status
drafted. §5 has nine criteria (projection totality by proptest overAnyValuevariants × classes; the three-file absent/mismatched scan; compaction re-projection across a re-typing; the dogfoodsum(attr.cost_usd)corpus gate as RFC0042.9). Implementation follows the ladder after this merges; #646 lands as a slice of it.Invariants
Doc-only. Touches hazard #5 (schema evolution) on paper: §3.6 keeps the additive-
OPTIONALclass and names the one new conflict case with its migration rule.mdbook buildclean; §3.1/§3.3/§7.1 quotes and the RFC0002.17try_castbehaviour re-verified against the current tree.