Support parametric arguments to FUNCTION for ClickHouse dialect (#1315)

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
hulk 2024-06-23 19:36:05 +08:00 committed by GitHub
parent 7a9793b72e
commit a685e11993
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 119 additions and 5 deletions

View file

@ -2369,6 +2369,7 @@ fn parse_array_subquery_expr() {
assert_eq!(
&Expr::Function(Function {
name: ObjectName(vec![Ident::new("ARRAY")]),
parameters: FunctionArguments::None,
args: FunctionArguments::Subquery(Box::new(Query {
with: None,
body: Box::new(SetExpr::SetOperation {
@ -2729,6 +2730,7 @@ fn test_composite_value() {
Ident::new("information_schema"),
Ident::new("_pg_expandarray")
]),
parameters: FunctionArguments::None,
args: FunctionArguments::List(FunctionArgumentList {
duplicate_treatment: None,
args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(Expr::Array(
@ -2955,6 +2957,7 @@ fn parse_current_functions() {
assert_eq!(
&Expr::Function(Function {
name: ObjectName(vec![Ident::new("CURRENT_CATALOG")]),
parameters: FunctionArguments::None,
args: FunctionArguments::None,
null_treatment: None,
filter: None,
@ -2966,6 +2969,7 @@ fn parse_current_functions() {
assert_eq!(
&Expr::Function(Function {
name: ObjectName(vec![Ident::new("CURRENT_USER")]),
parameters: FunctionArguments::None,
args: FunctionArguments::None,
null_treatment: None,
filter: None,
@ -2977,6 +2981,7 @@ fn parse_current_functions() {
assert_eq!(
&Expr::Function(Function {
name: ObjectName(vec![Ident::new("SESSION_USER")]),
parameters: FunctionArguments::None,
args: FunctionArguments::None,
null_treatment: None,
filter: None,
@ -2988,6 +2993,7 @@ fn parse_current_functions() {
assert_eq!(
&Expr::Function(Function {
name: ObjectName(vec![Ident::new("USER")]),
parameters: FunctionArguments::None,
args: FunctionArguments::None,
null_treatment: None,
filter: None,
@ -3438,6 +3444,7 @@ fn parse_delimited_identifiers() {
assert_eq!(
&Expr::Function(Function {
name: ObjectName(vec![Ident::with_quote('"', "myfun")]),
parameters: FunctionArguments::None,
args: FunctionArguments::List(FunctionArgumentList {
duplicate_treatment: None,
args: vec![],