@@ -57,7 +57,8 @@ use std::rc::Rc;
5757
5858use asap_types:: ir:: operator:: Reduction ;
5959use asap_types:: ir:: physical_export:: {
60- PhysicalASAPDAG , PhysicalASAPNodeId , PhysicalASAPOperatorPayload as Payload } ;
60+ PhysicalASAPDAG , PhysicalASAPNodeId , PhysicalASAPOperatorPayload as Payload ,
61+ } ;
6162use asap_types:: ir:: schema:: { DataType , Schema } ;
6263use asap_types:: ir:: schema:: {
6364 FieldDataType , SketchAlgorithm , SketchParams , SketchStatistic , WeightDomain ,
@@ -1098,8 +1099,12 @@ fn scan_extent_ms(dag: &PhysicalASAPDAG, id: PhysicalASAPNodeId, offset_ms: i64)
10981099 . filter_map ( |e| {
10991100 let consumer = dag. nodes . iter ( ) . find ( |n| n. id == e. consumer ) ?;
11001101 match & consumer. payload {
1101- Payload :: NonASAP ( NonASAPOp :: TimeShift { shift } ) => scan_extent_ms ( dag, consumer. id , offset_ms. saturating_add ( shift. offset_ms ) ) ,
1102- Payload :: NonASAP ( NonASAPOp :: TimeRange { range, .. } ) => Some ( ( range. as_millis ( ) as u64 ) . saturating_add ( offset_ms. max ( 0 ) as u64 ) ) ,
1102+ Payload :: NonASAP ( NonASAPOp :: TimeShift { shift, .. } ) => {
1103+ scan_extent_ms ( dag, consumer. id , offset_ms. saturating_add ( shift. offset_ms ) )
1104+ }
1105+ Payload :: NonASAP ( NonASAPOp :: TimeRange { range, .. } ) => {
1106+ Some ( ( range. as_millis ( ) as u64 ) . saturating_add ( offset_ms. max ( 0 ) as u64 ) )
1107+ }
11031108 _ => None ,
11041109 }
11051110 } )
@@ -1118,11 +1123,7 @@ fn price(
11181123 data : & DataWorkload ,
11191124 calibration : & Stage3Calibration ,
11201125) -> Result < CandidateCost , ( PhysicalASAPNodeId , AnalyticalCostError ) > {
1121- let first = dag
1122- . roots
1123- . first ( )
1124- . copied ( )
1125- . unwrap_or ( 0 ) ;
1126+ let first = dag. roots . first ( ) . copied ( ) . unwrap_or ( 0 ) ;
11261127 calibration. validate ( ) . map_err ( |error| ( first, error) ) ?;
11271128 let series = data
11281129 . input_cardinality
@@ -2024,10 +2025,7 @@ mod tests {
20242025 }
20252026
20262027 fn is_scan ( payload : & Payload ) -> bool {
2027- matches ! (
2028- payload,
2029- Payload :: NonASAP ( NonASAPOp :: Scan { .. } )
2030- )
2028+ matches ! ( payload, Payload :: NonASAP ( NonASAPOp :: Scan { .. } ) )
20312029 }
20322030
20332031 fn is_build ( payload : & Payload ) -> bool {
0 commit comments