Skip to content

Commit

Permalink
improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
francis-du committed Nov 20, 2022
1 parent 6cfeb9d commit 78f999e
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/sql/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,23 +269,14 @@ impl<'a> ParserContext<'a> {
_ => false,
};

let explain_statement = if has_describe_alias {
let explain_statement =
self.parser
.parse_explain(false)
.parse_explain(has_describe_alias)
.with_context(|_| error::UnexpectedSnafu {
sql: self.sql,
expected: "a statement",
actual: self.peek_token_as_string(),
})?
} else {
self.parser
.parse_explain(false)
.with_context(|_| error::UnexpectedSnafu {
sql: self.sql,
expected: "a statement",
actual: self.peek_token_as_string(),
})?
};
})?;

Ok(Statement::Explain(Explain::try_from(explain_statement)?))
}
Expand Down

0 comments on commit 78f999e

Please sign in to comment.