mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-30 18:57:21 +00:00
Enhance object name path segments (#1539)
This commit is contained in:
parent
fd6c98e933
commit
211b15e790
20 changed files with 584 additions and 466 deletions
|
@ -39,7 +39,7 @@ fn test_square_brackets_over_db_schema_table_name() {
|
|||
assert_eq!(
|
||||
select.from[0],
|
||||
TableWithJoins {
|
||||
relation: table_from_name(ObjectName(vec![
|
||||
relation: table_from_name(ObjectName::from(vec![
|
||||
Ident {
|
||||
value: "test_schema".to_string(),
|
||||
quote_style: Some('['),
|
||||
|
@ -81,7 +81,7 @@ fn test_double_quotes_over_db_schema_table_name() {
|
|||
assert_eq!(
|
||||
select.from[0],
|
||||
TableWithJoins {
|
||||
relation: table_from_name(ObjectName(vec![
|
||||
relation: table_from_name(ObjectName::from(vec![
|
||||
Ident {
|
||||
value: "test_schema".to_string(),
|
||||
quote_style: Some('"'),
|
||||
|
@ -114,7 +114,10 @@ fn parse_delimited_identifiers() {
|
|||
version,
|
||||
..
|
||||
} => {
|
||||
assert_eq!(vec![Ident::with_quote('"', "a table")], name.0);
|
||||
assert_eq!(
|
||||
ObjectName::from(vec![Ident::with_quote('"', "a table")]),
|
||||
name
|
||||
);
|
||||
assert_eq!(Ident::with_quote('"', "alias"), alias.unwrap().name);
|
||||
assert!(args.is_none());
|
||||
assert!(with_hints.is_empty());
|
||||
|
@ -133,7 +136,7 @@ fn parse_delimited_identifiers() {
|
|||
);
|
||||
assert_eq!(
|
||||
&Expr::Function(Function {
|
||||
name: ObjectName(vec![Ident::with_quote('"', "myfun")]),
|
||||
name: ObjectName::from(vec![Ident::with_quote('"', "myfun")]),
|
||||
uses_odbc_syntax: false,
|
||||
parameters: FunctionArguments::None,
|
||||
args: FunctionArguments::List(FunctionArgumentList {
|
||||
|
@ -297,7 +300,7 @@ fn test_parse_json_path_from() {
|
|||
TableFactor::Table {
|
||||
name, json_path, ..
|
||||
} => {
|
||||
assert_eq!(name, &ObjectName(vec![Ident::new("src")]));
|
||||
assert_eq!(name, &ObjectName::from(vec![Ident::new("src")]));
|
||||
assert_eq!(
|
||||
json_path,
|
||||
&Some(JsonPath {
|
||||
|
@ -321,7 +324,7 @@ fn test_parse_json_path_from() {
|
|||
TableFactor::Table {
|
||||
name, json_path, ..
|
||||
} => {
|
||||
assert_eq!(name, &ObjectName(vec![Ident::new("src")]));
|
||||
assert_eq!(name, &ObjectName::from(vec![Ident::new("src")]));
|
||||
assert_eq!(
|
||||
json_path,
|
||||
&Some(JsonPath {
|
||||
|
@ -354,7 +357,7 @@ fn test_parse_json_path_from() {
|
|||
} => {
|
||||
assert_eq!(
|
||||
name,
|
||||
&ObjectName(vec![Ident::new("src"), Ident::new("a"), Ident::new("b")])
|
||||
&ObjectName::from(vec![Ident::new("src"), Ident::new("a"), Ident::new("b")])
|
||||
);
|
||||
assert_eq!(json_path, &None);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue