44//! target, not ranked plans or accuracy certificates. Workload composition and
55//! physical planning consume this inventory later; empirical models belong to
66//! selection. The legacy search API remains until planner cutover.
7- use std:: collections:: { BTreeMap , HashMap , HashSet } ;
7+ use std:: collections:: { HashMap , HashSet } ;
88use std:: rc:: Rc ;
99
10- use asap_types:: ir:: summary_coverage:: { CoverageRegion , SummaryCoverage } ;
1110use asap_types:: ir:: { ASAPOp , NonASAPOp , Operator , OperatorNode , QueryRoot , SchemaDerivationError } ;
1211use asap_types:: post_asap:: {
1312 EntityIdentity , ExactKind , ExactParams , FieldDataType , GroupingStrategy ,
@@ -197,7 +196,7 @@ fn rewrite(
197196 Some ( realization) if * * realization != Realization :: PassThrough => {
198197 realize ( node, realization, memo) ?
199198 }
200- _ if changed => Rc :: new ( node. map_children ( |child| memo[ & Rc :: as_ptr ( child) ] . clone ( ) ) ?) ,
199+ _ if changed => Rc :: new ( node. with_new_children ( |child| memo[ & Rc :: as_ptr ( child) ] . clone ( ) ) ?) ,
201200 _ => node. clone ( ) ,
202201 } ;
203202 memo. insert ( Rc :: as_ptr ( node) , rebuilt. clone ( ) ) ;
@@ -253,16 +252,7 @@ fn realize(
253252 grouping : GroupingStrategy :: default ( ) ,
254253 filter : None ,
255254 } ) ) ?;
256- // Whole-source coverage is declared, not proven: Pass 1 trusts that the
257- // state holds every observation of its source that reaches it (#570).
258- let coverage = SummaryCoverage {
259- source : single_source ( & child) ?,
260- regions : vec ! [ CoverageRegion {
261- time_ms: None ,
262- population: BTreeMap :: new( ) ,
263- } ] ,
264- } ;
265- let state = Rc :: new ( state. with_coverage ( coverage) ?) ;
255+ let state = Rc :: new ( state) ;
266256 let evaluation = match query {
267257 Some ( query) => ASAPOp :: SummaryEstimate {
268258 summary_input : state,
@@ -273,25 +263,6 @@ fn realize(
273263 Ok ( OperatorNode :: new_shared ( Operator :: ASAP ( evaluation) ) ?)
274264}
275265
276- fn single_source (
277- node : & Rc < OperatorNode > ,
278- ) -> Result < asap_types:: pre_asap:: Source , LogicalCandidateError > {
279- let mut sources = Vec :: new ( ) ;
280- for node in OperatorNode :: reachable ( node) {
281- if let Some ( NonASAPOp :: Scan { source, .. } ) = node. non_asap ( ) {
282- if !sources. contains ( source) {
283- sources. push ( source. clone ( ) ) ;
284- }
285- }
286- }
287- match <[ _ ; 1 ] >:: try_from ( sources) {
288- Ok ( [ source] ) => Ok ( source) ,
289- Err ( _) => Err ( LogicalCandidateError :: Unsupported (
290- "summary coverage needs exactly one source" ,
291- ) ) ,
292- }
293- }
294-
295266/// What each input row contributes, following the legacy realization rules:
296267/// heap sketches rank series identities, frequency sketches count values, and
297268/// every other family reads the measure's input column.
0 commit comments