mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 03:07:20 +00:00
Simplify JOIN USING (columns)
...by reusing `parse_column_names` instead of extracting identifiers out of the `parse_expr_list`s result.
This commit is contained in:
parent
05a70a358a
commit
b716ffb937
1 changed files with 1 additions and 11 deletions
|
@ -1201,17 +1201,7 @@ impl Parser {
|
|||
Ok(JoinConstraint::On(constraint))
|
||||
} else if self.parse_keyword("USING") {
|
||||
self.expect_token(&Token::LParen)?;
|
||||
let attributes = self
|
||||
.parse_expr_list()?
|
||||
.into_iter()
|
||||
.map(|ast_node| match ast_node {
|
||||
ASTNode::SQLIdentifier(ident) => Ok(ident),
|
||||
unexpected => {
|
||||
parser_err!(format!("Expected identifier, found {:?}", unexpected))
|
||||
}
|
||||
})
|
||||
.collect::<Result<Vec<String>, ParserError>>()?;
|
||||
|
||||
let attributes = self.parse_column_names()?;
|
||||
self.expect_token(&Token::RParen)?;
|
||||
Ok(JoinConstraint::Using(attributes))
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue