mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
Add support for parsing empty dictionary expressions (#1684)
This commit is contained in:
parent
cbe59a2d8b
commit
74163b148e
2 changed files with 4 additions and 1 deletions
|
@ -2854,7 +2854,8 @@ impl<'a> Parser<'a> {
|
|||
fn parse_duckdb_struct_literal(&mut self) -> Result<Expr, ParserError> {
|
||||
self.expect_token(&Token::LBrace)?;
|
||||
|
||||
let fields = self.parse_comma_separated(Self::parse_duckdb_dictionary_field)?;
|
||||
let fields =
|
||||
self.parse_comma_separated0(Self::parse_duckdb_dictionary_field, Token::RBrace)?;
|
||||
|
||||
self.expect_token(&Token::RBrace)?;
|
||||
|
||||
|
|
|
@ -11291,6 +11291,8 @@ fn test_dictionary_syntax() {
|
|||
);
|
||||
}
|
||||
|
||||
check("{}", Expr::Dictionary(vec![]));
|
||||
|
||||
check(
|
||||
"{'Alberta': 'Edmonton', 'Manitoba': 'Winnipeg'}",
|
||||
Expr::Dictionary(vec![
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue