Repository navigation
Open
Labels
accuracyAccuracy requirements, guarantees, and propagationAccuracy requirements, guarantees, and propagationbugSomething isn't workingSomething isn't workingreplacement-strategyASAP replacement candidates and physical strategiesASAP replacement candidates and physical strategies
Description
Problem, by example
stage_pipeline --table '{"name":"metrics","columns":[{"name":"ts","type":"timestamp","nullable":false},{"name":"service","type":"utf8","nullable":false}],"time_index":0}' \
--sql "SELECT COUNT(*) FROM metrics" --epsilon 0.01 --delta 0.001
- Stage 1 lists
L3 Q1 CountSketch. - Stage 3 marks P3 valid ("accepted absolute_stream_l2 (CountSketch)", cost 0.00254/s, against 0.0000733/s for exact P1). P3 is only rejected because it costs more.
- If P3 were selected (for example, if the exact plan were priced higher), lowering would fail.
validate_sketch_evaluation(crates/asap-physical-operators/src/capability.rs) accepts a barePointCount { value: None }only for Count-Min, Hll, Kmv, DDSketch and UnivMon; for CountSketch it returns "evaluation is not implemented for this summary family".
Expected: no CountSketch candidate for a count, or a CountSketch total the executor can evaluate.
Cause
realizations_for_intent(crates/asap-aware-mapping/src/realization.rs) mapsAggIntent::Countto[Cms, CountSketch, UnivMon].- The CountSketch accuracy model (
count_sketch_l2_median_binomial_v1) then gives the total a single-item point-query bound, ε‖f‖₂, which is not a contract for a total. - The family-capability table has no
(Total, …)row for CountSketch. Itsmerged_errorkeeps a fallback default for unanswered statistics only so that this candidate's paned guarantee stays as it was.
Proposal
Drop CountSketch from AggIntent::Count. A CountSketch's signed counters don't add up to the total, and Count-Min and UnivMon already cover counts. Then remove the merged_error fallback, so a statistic the family doesn't answer fails closed (None).
The alternative is an executor kernel plus an accuracy contract for a CountSketch total, and then a (Total, AsIfBuiltOverUnion) row.
Scope / acceptance
- The example above lists no CountSketch candidate.
merged_errorreturnsNonefor any statistic outside the family's row, and thefamily_capability_tabletest asserts it for every row.- Examples 1–4 select the same plans at the same costs.
Status / related
Found while reviewing #724, which keeps the fallback so behaviour is unchanged. Related: #696, #707.
Metadata
Metadata
Assignees
Labels
accuracyAccuracy requirements, guarantees, and propagationAccuracy requirements, guarantees, and propagationbugSomething isn't workingSomething isn't workingreplacement-strategyASAP replacement candidates and physical strategiesASAP replacement candidates and physical strategies
Activity