Make FileFormat case insensitive (#200)

This commit is contained in:
Daniël Heres 2020-06-12 17:10:44 +02:00 committed by GitHub
parent a0f076acda
commit 68afa2a764
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View file

@ -1006,7 +1006,12 @@ impl Parser {
let table_name = self.parse_object_name()?;
let (columns, constraints) = self.parse_columns()?;
self.expect_keywords(&[Keyword::STORED, Keyword::AS])?;
let file_format = self.parse_identifier()?.value.parse::<FileFormat>()?;
// We probably shouldn't parse the file format as an identifier..
let file_format = self
.parse_identifier()?
.value
.to_ascii_uppercase()
.parse::<FileFormat>()?;
self.expect_keyword(Keyword::LOCATION)?;
let location = self.parse_literal_string()?;