Consolidate representation of function calls, remove AggregateExpressionWithFilter, ArraySubquery, ListAgg and ArrayAgg (#1247)

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
Joey Hain 2024-05-03 11:46:03 -07:00 committed by GitHub
parent 5ea9c01bb2
commit a14faa36bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 773 additions and 1040 deletions

View file

@ -1634,78 +1634,23 @@ fn parse_insert_with_on_duplicate_update() {
Some(OnInsert::DuplicateKeyUpdate(vec![
Assignment {
id: vec![Ident::new("description".to_string())],
value: Expr::Function(Function {
name: ObjectName(vec![Ident::new("VALUES".to_string()),]),
args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(
Expr::Identifier(Ident::new("description"))
))],
null_treatment: None,
filter: None,
over: None,
distinct: false,
special: false,
order_by: vec![],
})
value: call("VALUES", [Expr::Identifier(Ident::new("description"))]),
},
Assignment {
id: vec![Ident::new("perm_create".to_string())],
value: Expr::Function(Function {
name: ObjectName(vec![Ident::new("VALUES".to_string()),]),
args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(
Expr::Identifier(Ident::new("perm_create"))
))],
null_treatment: None,
filter: None,
over: None,
distinct: false,
special: false,
order_by: vec![],
})
value: call("VALUES", [Expr::Identifier(Ident::new("perm_create"))]),
},
Assignment {
id: vec![Ident::new("perm_read".to_string())],
value: Expr::Function(Function {
name: ObjectName(vec![Ident::new("VALUES".to_string()),]),
args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(
Expr::Identifier(Ident::new("perm_read"))
))],
null_treatment: None,
filter: None,
over: None,
distinct: false,
special: false,
order_by: vec![],
})
value: call("VALUES", [Expr::Identifier(Ident::new("perm_read"))]),
},
Assignment {
id: vec![Ident::new("perm_update".to_string())],
value: Expr::Function(Function {
name: ObjectName(vec![Ident::new("VALUES".to_string()),]),
args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(
Expr::Identifier(Ident::new("perm_update"))
))],
null_treatment: None,
filter: None,
over: None,
distinct: false,
special: false,
order_by: vec![],
})
value: call("VALUES", [Expr::Identifier(Ident::new("perm_update"))]),
},
Assignment {
id: vec![Ident::new("perm_delete".to_string())],
value: Expr::Function(Function {
name: ObjectName(vec![Ident::new("VALUES".to_string()),]),
args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(
Expr::Identifier(Ident::new("perm_delete"))
))],
null_treatment: None,
filter: None,
over: None,
distinct: false,
special: false,
order_by: vec![],
})
value: call("VALUES", [Expr::Identifier(Ident::new("perm_delete"))]),
},
])),
on
@ -2385,16 +2330,7 @@ fn parse_table_colum_option_on_update() {
collation: None,
options: vec![ColumnOptionDef {
name: None,
option: ColumnOption::OnUpdate(Expr::Function(Function {
name: ObjectName(vec![Ident::new("CURRENT_TIMESTAMP")]),
args: vec![],
null_treatment: None,
filter: None,
over: None,
distinct: false,
special: false,
order_by: vec![],
})),
option: ColumnOption::OnUpdate(call("CURRENT_TIMESTAMP", [])),
},],
}],
columns