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 16, 2022
1 parent 15ae646 commit cc96d5a
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 @@ -228,23 +228,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 cc96d5a

Please sign in to comment.