Parse a SELECT statement
(select: Select, limit: Option<Box<str>>)
| 360 | |
| 361 | /// Parse a SELECT statement |
| 362 | fn parse_select(select: Select, limit: Option<Box<str>>) -> SqlParseResult<SqlSelect> { |
| 363 | match select { |
| 364 | Select { |
| 365 | distinct: None, |
| 366 | top: None, |
| 367 | projection, |
| 368 | into: None, |
| 369 | from, |
| 370 | lateral_views, |
| 371 | selection, |
| 372 | group_by: GroupByExpr::Expressions(exprs), |
| 373 | cluster_by, |
| 374 | distribute_by, |
| 375 | sort_by, |
| 376 | having: None, |
| 377 | named_window, |
| 378 | qualify: None, |
| 379 | } if lateral_views.is_empty() |
| 380 | && exprs.is_empty() |
| 381 | && cluster_by.is_empty() |
| 382 | && distribute_by.is_empty() |
| 383 | && sort_by.is_empty() |
| 384 | && named_window.is_empty() => |
| 385 | { |
| 386 | Ok(SqlSelect { |
| 387 | project: parse_projection(projection)?, |
| 388 | from: SqlParser::parse_from(from)?, |
| 389 | filter: parse_expr_opt(selection)?, |
| 390 | limit, |
| 391 | }) |
| 392 | } |
| 393 | _ => Err(SqlUnsupported::feature(select).into()), |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | #[cfg(test)] |
| 398 | mod tests { |
no test coverage detected
searching dependent graphs…