mustafasrepo commented on code in PR #6352:
URL: https://github.com/apache/arrow-datafusion/pull/6352#discussion_r1194783100
##########
datafusion/sql/src/parser.rs:
##########
@@ -427,39 +435,72 @@ impl<'a> DFParser<'a> {
}
loop {
- if self.parser.parse_keyword(Keyword::STORED) {
- self.parser.expect_keyword(Keyword::AS)?;
- ensure_not_set(&builder.file_type, "STORED AS")?;
- builder.file_type = Some(self.parse_file_format()?);
- } else if self.parser.parse_keyword(Keyword::LOCATION) {
- ensure_not_set(&builder.location, "LOCATION")?;
- builder.location = Some(self.parser.parse_literal_string()?);
- } else if self.parser.parse_keyword(Keyword::WITH) {
- if self.parser.parse_keyword(Keyword::ORDER) {
- ensure_not_set(&builder.order_exprs, "WITH ORDER")?;
- builder.order_exprs = Some(self.parse_order_by_exprs()?);
- } else {
- self.parser.expect_keyword(Keyword::HEADER)?;
- self.parser.expect_keyword(Keyword::ROW)?;
- ensure_not_set(&builder.has_header, "WITH HEADER ROW")?;
- builder.has_header = Some(true);
+ if let Some(keyword) = self.parser.parse_one_of_keywords(&[
Review Comment:
Nice cleanup!.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]