mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-24 07:54:06 +00:00
update
This commit is contained in:
parent
a2453366f9
commit
12f8543a07
2 changed files with 1 additions and 10 deletions
|
@ -1336,7 +1336,7 @@ pub enum TableFactor {
|
||||||
Pivot {
|
Pivot {
|
||||||
table: Box<TableFactor>,
|
table: Box<TableFactor>,
|
||||||
aggregate_functions: Vec<ExprWithAlias>, // Function expression
|
aggregate_functions: Vec<ExprWithAlias>, // Function expression
|
||||||
value_column: Vec<Expr>, // Expr is a identifier or a compound identifier
|
value_column: Vec<Expr>,
|
||||||
value_source: PivotValueSource,
|
value_source: PivotValueSource,
|
||||||
default_on_null: Option<Expr>,
|
default_on_null: Option<Expr>,
|
||||||
alias: Option<TableAlias>,
|
alias: Option<TableAlias>,
|
||||||
|
|
|
@ -10925,15 +10925,6 @@ fn parse_pivot_table() {
|
||||||
verified_stmt(sql_without_table_alias).to_string(),
|
verified_stmt(sql_without_table_alias).to_string(),
|
||||||
sql_without_table_alias
|
sql_without_table_alias
|
||||||
);
|
);
|
||||||
|
|
||||||
let sql_with_multiple_value_column = concat!(
|
|
||||||
"SELECT * FROM person ",
|
|
||||||
"PIVOT(SUM(age) AS a, AVG(class) AS c FOR (name, age) IN (('John', 30) AS c1, ('Mike', 40) AS c2))"
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
verified_stmt(sql_with_multiple_value_column).to_string(),
|
|
||||||
sql_with_multiple_value_column
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue