Parse a SQL `CREATE` statement handling `CREATE EXTERNAL TABLE`
(&mut self)
| 831 | |
| 832 | /// Parse a SQL `CREATE` statement handling `CREATE EXTERNAL TABLE` |
| 833 | pub fn parse_create(&mut self) -> Result<Statement, DataFusionError> { |
| 834 | // TODO: Change sql parser to take in `or_replace: bool` inside parse_create() |
| 835 | if self |
| 836 | .parser |
| 837 | .parse_keywords(&[Keyword::OR, Keyword::REPLACE, Keyword::EXTERNAL]) |
| 838 | { |
| 839 | self.parse_create_external_table(false, true) |
| 840 | } else if self.parser.parse_keywords(&[ |
| 841 | Keyword::OR, |
| 842 | Keyword::REPLACE, |
| 843 | Keyword::UNBOUNDED, |
| 844 | Keyword::EXTERNAL, |
| 845 | ]) { |
| 846 | self.parse_create_external_table(true, true) |
| 847 | } else if self.parser.parse_keyword(Keyword::EXTERNAL) { |
| 848 | self.parse_create_external_table(false, false) |
| 849 | } else if self |
| 850 | .parser |
| 851 | .parse_keywords(&[Keyword::UNBOUNDED, Keyword::EXTERNAL]) |
| 852 | { |
| 853 | self.parse_create_external_table(true, false) |
| 854 | } else { |
| 855 | Ok(Statement::Statement(Box::from(self.parser.parse_create()?))) |
| 856 | } |
| 857 | } |
| 858 | |
| 859 | fn parse_partitions(&mut self) -> Result<Vec<String>, DataFusionError> { |
| 860 | let mut partitions: Vec<String> = vec![]; |
no test coverage detected