(bound: &ast::WindowFrameBound)
| 66 | } |
| 67 | |
| 68 | fn convert_window_frame_bound(bound: &ast::WindowFrameBound) -> Result<FrameBound> { |
| 69 | match bound { |
| 70 | ast::WindowFrameBound::CurrentRow => Ok(FrameBound::CurrentRow), |
| 71 | ast::WindowFrameBound::Preceding(None) => Ok(FrameBound::UnboundedPreceding), |
| 72 | ast::WindowFrameBound::Following(None) => Ok(FrameBound::UnboundedFollowing), |
| 73 | ast::WindowFrameBound::Preceding(Some(expr)) => { |
| 74 | Ok(FrameBound::Preceding(extract_frame_offset(expr)?)) |
| 75 | } |
| 76 | ast::WindowFrameBound::Following(Some(expr)) => { |
| 77 | Ok(FrameBound::Following(extract_frame_offset(expr)?)) |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | /// Parse a frame offset from a literal. Only non-negative integer literals that |
| 83 | /// fit in a `u64` are accepted; anything else (expression, float, oversized |
no test coverage detected