@@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize};
77
88use super :: node:: { OperatorNode , OperatorResultKind } ;
99use crate :: ir:: operator_properties:: Reduction ;
10- use crate :: ir:: QueryExprError ;
10+ use crate :: ir:: SchemaDerivationError ;
1111use crate :: post_asap:: maintained_population:: { MaintainedPopulation , PopulationStatistic } ;
1212use crate :: post_asap:: sketch:: { GroupingStrategy , SketchStatistic , SummaryUpdate } ;
1313use crate :: pre_asap:: schema:: { ColumnId , DataType , Field , FieldDataType , Schema } ;
@@ -194,8 +194,8 @@ impl ASAPOp {
194194 )
195195 }
196196
197- fn unimplemented ( ) -> QueryExprError {
198- QueryExprError :: InvalidScalarSignature ( UNIMPLEMENTED_ASAP_OP . into ( ) )
197+ fn unimplemented ( ) -> SchemaDerivationError {
198+ SchemaDerivationError :: InvalidScalarSignature ( UNIMPLEMENTED_ASAP_OP . into ( ) )
199199 }
200200
201201 /// The summary state this operator produces, if it produces state.
@@ -210,7 +210,7 @@ impl ASAPOp {
210210 /// planning may retain a more specific schema (evaluation column naming)
211211 /// through [`OperatorNode::with_schema`]; the derived shape agrees with it
212212 /// in field types.
213- pub fn output_schema ( & self ) -> Result < Schema , QueryExprError > {
213+ pub fn output_schema ( & self ) -> Result < Schema , SchemaDerivationError > {
214214 use ASAPOp :: * ;
215215 Ok ( match self {
216216 SummaryAgg {
@@ -230,7 +230,7 @@ impl ASAPOp {
230230 & crate :: pre_asap:: ColumnRef :: SampleValue ,
231231 & schema,
232232 )
233- . map_err ( |e| QueryExprError :: InvalidScalarSignature ( e. to_string ( ) ) ) ?,
233+ . map_err ( |e| SchemaDerivationError :: InvalidScalarSignature ( e. to_string ( ) ) ) ?,
234234 Reduction :: Reduce ( _) => schema. fields . len ( ) - 1 ,
235235 } ;
236236 schema. fields [ index] = Field :: new ( "state" , family. clone ( ) , false ) ;
@@ -286,7 +286,7 @@ impl ASAPOp {
286286 & source. schema ,
287287 )
288288 . map_err ( |e| {
289- QueryExprError :: InvalidScalarSignature ( e. to_string ( ) )
289+ SchemaDerivationError :: InvalidScalarSignature ( e. to_string ( ) )
290290 } ) ?,
291291 ) ,
292292 _ => None ,
@@ -349,7 +349,7 @@ impl ASAPOp {
349349 population,
350350 } ) = child. asap ( )
351351 else {
352- return Err ( QueryExprError :: InvalidScalarSignature (
352+ return Err ( SchemaDerivationError :: InvalidScalarSignature (
353353 "population evaluation requires maintained membership" . into ( ) ,
354354 ) ) ;
355355 } ;
@@ -368,7 +368,7 @@ impl ASAPOp {
368368 . iter ( )
369369 . map ( |name| {
370370 source. schema . column_id ( name) . ok_or_else ( || {
371- QueryExprError :: InvalidScalarSignature (
371+ SchemaDerivationError :: InvalidScalarSignature (
372372 "population grouping column is absent" . into ( ) ,
373373 )
374374 } )
@@ -433,11 +433,11 @@ impl ASAPOp {
433433 }
434434
435435 /// Local input-contract checks.
436- pub fn validate_inputs ( & self ) -> Result < ( ) , QueryExprError > {
436+ pub fn validate_inputs ( & self ) -> Result < ( ) , SchemaDerivationError > {
437437 use ASAPOp :: * ;
438438 let needs_state = |node : & OperatorNode , what : & str | {
439439 if node. result_kind != OperatorResultKind :: State {
440- Err ( QueryExprError :: InvalidScalarSignature ( format ! (
440+ Err ( SchemaDerivationError :: InvalidScalarSignature ( format ! (
441441 "{what} requires summary state as input, got {:?}" ,
442442 node. result_kind
443443 ) ) )
@@ -480,7 +480,7 @@ impl ASAPOp {
480480 _ => false ,
481481 } ;
482482 if !valid {
483- return Err ( QueryExprError :: InvalidScalarSignature (
483+ return Err ( SchemaDerivationError :: InvalidScalarSignature (
484484 "evaluation does not match its summary family" . into ( ) ,
485485 ) ) ;
486486 }
@@ -494,7 +494,7 @@ impl ASAPOp {
494494 . iter ( )
495495 . all ( |f| !matches ! ( f. dtype, FieldDataType :: ExactAggregate ( ..) ) )
496496 {
497- return Err ( QueryExprError :: InvalidScalarSignature (
497+ return Err ( SchemaDerivationError :: InvalidScalarSignature (
498498 "FinalizeExactAccumulator requires exact accumulator state" . into ( ) ,
499499 ) ) ;
500500 }
@@ -504,7 +504,7 @@ impl ASAPOp {
504504 needs_state ( child, "EvaluatePopulation" ) ?;
505505 if !matches ! ( child. asap( ) , Some ( MaintainPopulation { population, .. } ) if population. supports( evaluation) )
506506 {
507- return Err ( QueryExprError :: InvalidScalarSignature (
507+ return Err ( SchemaDerivationError :: InvalidScalarSignature (
508508 "population evaluation requires compatible maintained membership" . into ( ) ,
509509 ) ) ;
510510 }
@@ -518,19 +518,19 @@ impl ASAPOp {
518518 ..
519519 } => {
520520 if family. is_plain ( ) || child. result_kind == OperatorResultKind :: State {
521- return Err ( QueryExprError :: InvalidScalarSignature (
521+ return Err ( SchemaDerivationError :: InvalidScalarSignature (
522522 "summary aggregation requires values and produces a state family" . into ( ) ,
523523 ) ) ;
524524 }
525525 fn check (
526526 expr : & crate :: post_asap:: SummaryInputExpr ,
527527 schema : & Schema ,
528- ) -> Result < ( ) , QueryExprError > {
528+ ) -> Result < ( ) , SchemaDerivationError > {
529529 use crate :: post_asap:: SummaryInputExpr ;
530530 match expr {
531531 SummaryInputExpr :: Column ( col) => {
532532 crate :: pre_asap:: resolve_column_ref ( col, schema) . map_err ( |e| {
533- QueryExprError :: InvalidScalarSignature ( e. to_string ( ) )
533+ SchemaDerivationError :: InvalidScalarSignature ( e. to_string ( ) )
534534 } ) ?;
535535 }
536536 SummaryInputExpr :: Tuple ( items) => {
@@ -548,7 +548,7 @@ impl ASAPOp {
548548 }
549549 if let Some ( filter) = filter {
550550 if filter. 0 . scalar_type ( & child. schema ) ?. 0 != DataType :: Bool {
551- return Err ( QueryExprError :: InvalidScalarSignature (
551+ return Err ( SchemaDerivationError :: InvalidScalarSignature (
552552 "summary filter must be boolean" . into ( ) ,
553553 ) ) ;
554554 }
@@ -557,7 +557,7 @@ impl ASAPOp {
557557 }
558558 MaintainPopulation { child, population } => {
559559 if !population. matches_node ( child) {
560- return Err ( QueryExprError :: InvalidScalarSignature (
560+ return Err ( SchemaDerivationError :: InvalidScalarSignature (
561561 "population input differs from its membership contract" . into ( ) ,
562562 ) ) ;
563563 }
0 commit comments