Helper method to parse a statement and handle errors consistently, especially for recursion limits
(&mut self)
| 608 | |
| 609 | /// Helper method to parse a statement and handle errors consistently, especially for recursion limits |
| 610 | fn parse_and_handle_statement(&mut self) -> Result<Statement, DataFusionError> { |
| 611 | self.parser |
| 612 | .parse_statement() |
| 613 | .map(|stmt| Statement::Statement(Box::from(stmt))) |
| 614 | .map_err(|e| match e { |
| 615 | ParserError::RecursionLimitExceeded => DataFusionError::SQL( |
| 616 | Box::new(ParserError::RecursionLimitExceeded), |
| 617 | Some(format!( |
| 618 | " (current limit: {})", |
| 619 | self.options.recursion_limit |
| 620 | )), |
| 621 | ), |
| 622 | other => DataFusionError::SQL(Box::new(other), None), |
| 623 | }) |
| 624 | } |
| 625 | |
| 626 | /// Parse a SQL `COPY TO` statement |
| 627 | pub fn parse_copy(&mut self) -> Result<Statement, DataFusionError> { |
no test coverage detected