(&mut self)
| 857 | } |
| 858 | |
| 859 | fn parse_partitions(&mut self) -> Result<Vec<String>, DataFusionError> { |
| 860 | let mut partitions: Vec<String> = vec![]; |
| 861 | if !self.parser.consume_token(&Token::LParen) |
| 862 | || self.parser.consume_token(&Token::RParen) |
| 863 | { |
| 864 | return Ok(partitions); |
| 865 | } |
| 866 | |
| 867 | loop { |
| 868 | if let Token::Word(_) = self.parser.peek_token().token { |
| 869 | let identifier = self.parser.parse_identifier()?; |
| 870 | partitions.push(identifier.to_string()); |
| 871 | } else { |
| 872 | return self.expected("partition name", &self.parser.peek_token()); |
| 873 | } |
| 874 | let comma = self.parser.consume_token(&Token::Comma); |
| 875 | if self.parser.consume_token(&Token::RParen) { |
| 876 | // allow a trailing comma, even though it's not in standard |
| 877 | break; |
| 878 | } else if !comma { |
| 879 | return self.expected( |
| 880 | "',' or ')' after partition definition", |
| 881 | &self.parser.peek_token(), |
| 882 | ); |
| 883 | } |
| 884 | } |
| 885 | Ok(partitions) |
| 886 | } |
| 887 | |
| 888 | /// Parse the ordering clause of a `CREATE EXTERNAL TABLE` SQL statement |
| 889 | pub fn parse_order_by_exprs(&mut self) -> Result<Vec<OrderByExpr>, DataFusionError> { |
no test coverage detected