mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-16 04:54:59 +00:00
Support redshift's columns definition list for system information functions (#769)
* parsing of redshift's column definition list for pg_get_late_binding_view_cols pg_get_cols pg_get_grantee_by_iam_role pg_get_iam_role_by_user * Renamed ColsDefinition to TableAliasDefinition added generic dialect * Tests fixed * Visitor for IdentPair * Parsing redshift table alias based on indentifier and parentheses instead of function name * fix clippy --------- Co-authored-by: Maciej Skrzypkowski <maciej.skrzypkowski@satoricyber.com> Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
parent
a2fea10f89
commit
c35dcc93a7
14 changed files with 194 additions and 0 deletions
|
@ -210,6 +210,7 @@ fn parse_update_set_from() {
|
|||
name: ObjectName(vec![Ident::new("t1")]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
joins: vec![],
|
||||
|
@ -236,6 +237,7 @@ fn parse_update_set_from() {
|
|||
name: ObjectName(vec![Ident::new("t1")]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
joins: vec![],
|
||||
|
@ -298,6 +300,7 @@ fn parse_update_with_table_alias() {
|
|||
columns: vec![],
|
||||
}),
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
joins: vec![],
|
||||
|
@ -353,6 +356,7 @@ fn parse_delete_statement() {
|
|||
name: ObjectName(vec![Ident::with_quote('"', "table")]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
table_name
|
||||
|
@ -379,6 +383,7 @@ fn parse_where_delete_statement() {
|
|||
name: ObjectName(vec![Ident::new("foo")]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
table_name,
|
||||
|
@ -419,6 +424,7 @@ fn parse_where_delete_with_alias_statement() {
|
|||
columns: vec![],
|
||||
}),
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
table_name,
|
||||
|
@ -432,6 +438,7 @@ fn parse_where_delete_with_alias_statement() {
|
|||
columns: vec![],
|
||||
}),
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
}),
|
||||
using
|
||||
|
@ -3447,6 +3454,7 @@ fn parse_interval_and_or_xor() {
|
|||
}]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
joins: vec![],
|
||||
|
@ -3893,6 +3901,7 @@ fn parse_implicit_join() {
|
|||
name: ObjectName(vec!["t1".into()]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
joins: vec![],
|
||||
|
@ -3902,6 +3911,7 @@ fn parse_implicit_join() {
|
|||
name: ObjectName(vec!["t2".into()]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
joins: vec![],
|
||||
|
@ -3919,6 +3929,7 @@ fn parse_implicit_join() {
|
|||
name: ObjectName(vec!["t1a".into()]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
joins: vec![Join {
|
||||
|
@ -3926,6 +3937,7 @@ fn parse_implicit_join() {
|
|||
name: ObjectName(vec!["t1b".into()]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
join_operator: JoinOperator::Inner(JoinConstraint::Natural),
|
||||
|
@ -3936,6 +3948,7 @@ fn parse_implicit_join() {
|
|||
name: ObjectName(vec!["t2a".into()]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
joins: vec![Join {
|
||||
|
@ -3943,6 +3956,7 @@ fn parse_implicit_join() {
|
|||
name: ObjectName(vec!["t2b".into()]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
join_operator: JoinOperator::Inner(JoinConstraint::Natural),
|
||||
|
@ -3963,6 +3977,7 @@ fn parse_cross_join() {
|
|||
name: ObjectName(vec![Ident::new("t2")]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
join_operator: JoinOperator::CrossJoin,
|
||||
|
@ -3983,6 +3998,7 @@ fn parse_joins_on() {
|
|||
name: ObjectName(vec![Ident::new(relation.into())]),
|
||||
alias,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
join_operator: f(JoinConstraint::On(Expr::BinaryOp {
|
||||
|
@ -4052,6 +4068,7 @@ fn parse_joins_using() {
|
|||
name: ObjectName(vec![Ident::new(relation.into())]),
|
||||
alias,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
join_operator: f(JoinConstraint::Using(vec!["c1".into()])),
|
||||
|
@ -4113,6 +4130,7 @@ fn parse_natural_join() {
|
|||
name: ObjectName(vec![Ident::new("t2")]),
|
||||
alias,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
join_operator: f(JoinConstraint::Natural),
|
||||
|
@ -4377,6 +4395,7 @@ fn parse_derived_tables() {
|
|||
name: ObjectName(vec!["t2".into()]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
join_operator: JoinOperator::Inner(JoinConstraint::Natural),
|
||||
|
@ -5668,6 +5687,7 @@ fn parse_merge() {
|
|||
columns: vec![],
|
||||
}),
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
}
|
||||
);
|
||||
|
@ -5691,6 +5711,7 @@ fn parse_merge() {
|
|||
name: ObjectName(vec![Ident::new("s"), Ident::new("foo")]),
|
||||
alias: None,
|
||||
args: None,
|
||||
columns_definition: None,
|
||||
with_hints: vec![],
|
||||
},
|
||||
joins: vec![],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue