Skip to content

Commit 4f0b340

Browse files
committed
fix ast
1 parent cdd15d6 commit 4f0b340

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/ast/query.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ pub enum TableFactor {
361361
/// +---------+--------+
362362
UNNEST {
363363
alias: Option<TableAlias>,
364-
expr: Expr,
364+
array_expr: Box<Expr>,
365365
with_offset: bool,
366366
},
367367
/// Represents a parenthesized table factor. The SQL spec only allows a
@@ -417,10 +417,10 @@ impl fmt::Display for TableFactor {
417417
}
418418
TableFactor::UNNEST {
419419
alias,
420-
expr,
420+
array_expr,
421421
with_offset,
422422
} => {
423-
write!(f, "UNNEST({})", expr)?;
423+
write!(f, "UNNEST({})", array_expr)?;
424424
if let Some(alias) = alias {
425425
write!(f, " AS {}", alias)?;
426426
}

src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3564,7 +3564,7 @@ impl<'a> Parser<'a> {
35643564

35653565
Ok(TableFactor::UNNEST {
35663566
alias,
3567-
expr,
3567+
array_expr: Box::new(expr),
35683568
with_offset,
35693569
})
35703570
} else {

tests/sqlparser_common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,7 @@ fn parse_unnest() {
27182718
name: Ident::new("numbers"),
27192719
columns: vec![],
27202720
}),
2721-
expr: Expr::Identifier(Ident::new("expr")),
2721+
array_expr: Box::new(Expr::Identifier(Ident::new("expr"))),
27222722
with_offset: true,
27232723
},
27242724
joins: vec![],

0 commit comments

Comments
 (0)