mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 14:28:22 +00:00
Support more DateTimeField
variants (#1191)
This commit is contained in:
parent
8dd213cff2
commit
127be97369
6 changed files with 129 additions and 46 deletions
|
@ -1462,6 +1462,19 @@ fn test_bigquery_trim() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_extract_weekday() {
|
||||
let sql = "SELECT EXTRACT(WEEK(MONDAY) FROM d)";
|
||||
let select = bigquery_and_generic().verified_only_select(sql);
|
||||
assert_eq!(
|
||||
&Expr::Extract {
|
||||
field: DateTimeField::Week(Some(Ident::new("MONDAY"))),
|
||||
expr: Box::new(Expr::Identifier(Ident::new("d"))),
|
||||
},
|
||||
expr_from_projection(only(&select.projection)),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_select_as_struct() {
|
||||
bigquery().verified_only_select("SELECT * FROM (SELECT AS VALUE STRUCT(123 AS a, false AS b))");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue