mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-30 10:47:22 +00:00
Support bigquery CAST AS x [STRING|DATE] FORMAT
syntax (#978)
This commit is contained in:
parent
83cb734b3c
commit
c68e9775a2
6 changed files with 130 additions and 6 deletions
|
@ -1934,6 +1934,7 @@ fn parse_cast() {
|
|||
&Expr::Cast {
|
||||
expr: Box::new(Expr::Identifier(Ident::new("id"))),
|
||||
data_type: DataType::BigInt(None),
|
||||
format: None,
|
||||
},
|
||||
expr_from_projection(only(&select.projection))
|
||||
);
|
||||
|
@ -1944,6 +1945,7 @@ fn parse_cast() {
|
|||
&Expr::Cast {
|
||||
expr: Box::new(Expr::Identifier(Ident::new("id"))),
|
||||
data_type: DataType::TinyInt(None),
|
||||
format: None,
|
||||
},
|
||||
expr_from_projection(only(&select.projection))
|
||||
);
|
||||
|
@ -1970,6 +1972,7 @@ fn parse_cast() {
|
|||
&Expr::Cast {
|
||||
expr: Box::new(Expr::Identifier(Ident::new("id"))),
|
||||
data_type: DataType::Nvarchar(Some(50)),
|
||||
format: None,
|
||||
},
|
||||
expr_from_projection(only(&select.projection))
|
||||
);
|
||||
|
@ -1980,6 +1983,7 @@ fn parse_cast() {
|
|||
&Expr::Cast {
|
||||
expr: Box::new(Expr::Identifier(Ident::new("id"))),
|
||||
data_type: DataType::Clob(None),
|
||||
format: None,
|
||||
},
|
||||
expr_from_projection(only(&select.projection))
|
||||
);
|
||||
|
@ -1990,6 +1994,7 @@ fn parse_cast() {
|
|||
&Expr::Cast {
|
||||
expr: Box::new(Expr::Identifier(Ident::new("id"))),
|
||||
data_type: DataType::Clob(Some(50)),
|
||||
format: None,
|
||||
},
|
||||
expr_from_projection(only(&select.projection))
|
||||
);
|
||||
|
@ -2000,6 +2005,7 @@ fn parse_cast() {
|
|||
&Expr::Cast {
|
||||
expr: Box::new(Expr::Identifier(Ident::new("id"))),
|
||||
data_type: DataType::Binary(Some(50)),
|
||||
format: None,
|
||||
},
|
||||
expr_from_projection(only(&select.projection))
|
||||
);
|
||||
|
@ -2010,6 +2016,7 @@ fn parse_cast() {
|
|||
&Expr::Cast {
|
||||
expr: Box::new(Expr::Identifier(Ident::new("id"))),
|
||||
data_type: DataType::Varbinary(Some(50)),
|
||||
format: None,
|
||||
},
|
||||
expr_from_projection(only(&select.projection))
|
||||
);
|
||||
|
@ -2020,6 +2027,7 @@ fn parse_cast() {
|
|||
&Expr::Cast {
|
||||
expr: Box::new(Expr::Identifier(Ident::new("id"))),
|
||||
data_type: DataType::Blob(None),
|
||||
format: None,
|
||||
},
|
||||
expr_from_projection(only(&select.projection))
|
||||
);
|
||||
|
@ -2030,6 +2038,7 @@ fn parse_cast() {
|
|||
&Expr::Cast {
|
||||
expr: Box::new(Expr::Identifier(Ident::new("id"))),
|
||||
data_type: DataType::Blob(Some(50)),
|
||||
format: None,
|
||||
},
|
||||
expr_from_projection(only(&select.projection))
|
||||
);
|
||||
|
@ -2043,6 +2052,7 @@ fn parse_try_cast() {
|
|||
&Expr::TryCast {
|
||||
expr: Box::new(Expr::Identifier(Ident::new("id"))),
|
||||
data_type: DataType::BigInt(None),
|
||||
format: None,
|
||||
},
|
||||
expr_from_projection(only(&select.projection))
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue