()
| 25 | } |
| 26 | |
| 27 | pub fn window_function_signatures() -> HashMap<&'static str, Signature> { |
| 28 | let mut map: HashMap<&'static str, Signature> = HashMap::new(); |
| 29 | map.insert( |
| 30 | "first_value", |
| 31 | Signature { |
| 32 | parameters: vec![Box::new(AnyType)], |
| 33 | return_type: Box::new(DynamicType { |
| 34 | function: first_element_type, |
| 35 | }), |
| 36 | }, |
| 37 | ); |
| 38 | |
| 39 | map.insert( |
| 40 | "nth_value", |
| 41 | Signature { |
| 42 | parameters: vec![Box::new(AnyType), Box::new(IntType)], |
| 43 | return_type: Box::new(DynamicType { |
| 44 | function: first_element_type, |
| 45 | }), |
| 46 | }, |
| 47 | ); |
| 48 | |
| 49 | map.insert( |
| 50 | "last_value", |
| 51 | Signature { |
| 52 | parameters: vec![Box::new(AnyType)], |
| 53 | return_type: Box::new(DynamicType { |
| 54 | function: first_element_type, |
| 55 | }), |
| 56 | }, |
| 57 | ); |
| 58 | |
| 59 | map.insert( |
| 60 | "row_number", |
| 61 | Signature { |
| 62 | parameters: vec![], |
| 63 | return_type: Box::new(IntType), |
| 64 | }, |
| 65 | ); |
| 66 | map |
| 67 | } |
| 68 | |
| 69 | pub fn window_first_value(frame: &[Vec<Box<dyn Value>>]) -> Vec<Box<dyn Value>> { |
| 70 | let frame_len = frame.len(); |
no outgoing calls
no test coverage detected
searching dependent graphs…