Parse a SELECT statement
(select: Select)
| 117 | |
| 118 | // Parse a SELECT statement |
| 119 | fn parse_select(select: Select) -> SqlParseResult<SqlSelect> { |
| 120 | match select { |
| 121 | Select { |
| 122 | distinct: None, |
| 123 | top: None, |
| 124 | projection, |
| 125 | into: None, |
| 126 | from, |
| 127 | lateral_views, |
| 128 | selection, |
| 129 | group_by: GroupByExpr::Expressions(exprs), |
| 130 | cluster_by, |
| 131 | distribute_by, |
| 132 | sort_by, |
| 133 | having: None, |
| 134 | named_window, |
| 135 | qualify: None, |
| 136 | } if lateral_views.is_empty() |
| 137 | && exprs.is_empty() |
| 138 | && cluster_by.is_empty() |
| 139 | && distribute_by.is_empty() |
| 140 | && sort_by.is_empty() |
| 141 | && named_window.is_empty() => |
| 142 | { |
| 143 | Ok(SqlSelect { |
| 144 | from: SubParser::parse_from(from)?, |
| 145 | filter: parse_expr_opt(selection)?, |
| 146 | project: parse_projection(projection)?, |
| 147 | }) |
| 148 | } |
| 149 | _ => Err(SubscriptionUnsupported::Select(select).into()), |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | #[cfg(test)] |
| 154 | mod tests { |
no test coverage detected
searching dependent graphs…