@@ -4022,25 +4022,6 @@ fn reject_uncertified_readouts(
40224022 reason : format ! ( "invalid executable subDAG: {error}" ) ,
40234023 }
40244024 } ) ?;
4025- // Leaf guarantees do not certify a composition (for example, division of
4026- // two approximate quantiles). Admission checks the complete query result.
4027- if dag. nodes . iter ( ) . any ( |node| {
4028- matches ! (
4029- node. payload,
4030- planner_types:: post_asap:: ExecutableOperatorPayload :: SummaryEstimate { .. }
4031- )
4032- } ) && root. guarantee . as_ref ( ) . is_none_or ( |guarantee| {
4033- !asap_aware_mapping:: accuracy:: AccuracyModel :: satisfies (
4034- & DefaultAccuracyModel ,
4035- guarantee,
4036- accuracy,
4037- )
4038- } ) {
4039- return Err ( CompileError :: Query {
4040- query_id : query_id. into ( ) ,
4041- reason : "selected query result has no certified accuracy guarantee satisfying the requested accuracy" . into ( ) ,
4042- } ) ;
4043- }
40444025 for node in & dag. nodes {
40454026 if target != PhysicalDeploymentTarget :: BackendLocalRemoteWrite
40464027 && node. guarantee . as_ref ( ) . is_some_and ( |guarantee| {
@@ -4071,6 +4052,25 @@ fn reject_uncertified_readouts(
40714052 } ) ;
40724053 }
40734054 }
4055+ // Leaf guarantees do not certify a composition (for example, division of
4056+ // two approximate quantiles). Admission checks the complete query result.
4057+ if dag. nodes . iter ( ) . any ( |node| {
4058+ matches ! (
4059+ node. payload,
4060+ planner_types:: post_asap:: ExecutableOperatorPayload :: SummaryEstimate { .. }
4061+ )
4062+ } ) && root. guarantee . as_ref ( ) . is_none_or ( |guarantee| {
4063+ !asap_aware_mapping:: accuracy:: AccuracyModel :: satisfies (
4064+ & asap_aware_mapping:: DefaultAccuracyModel ,
4065+ guarantee,
4066+ accuracy,
4067+ )
4068+ } ) {
4069+ return Err ( CompileError :: Query {
4070+ query_id : query_id. into ( ) ,
4071+ reason : "selected query result has no certified accuracy guarantee satisfying the requested accuracy" . into ( ) ,
4072+ } ) ;
4073+ }
40744074 Ok ( ( ) )
40754075}
40764076
@@ -5878,6 +5878,7 @@ pub(crate) mod tests {
58785878 let error = reject_uncertified_readouts (
58795879 "q" ,
58805880 & request. queries [ 0 ] . selected_plan_root ,
5881+ & request. queries [ 0 ] . accuracy_target ,
58815882 PhysicalDeploymentTarget :: DistributedCollectors ,
58825883 )
58835884 . unwrap_err ( ) ;
0 commit comments