Support more DateTimeField variants (#1191)

This commit is contained in:
Ifeanyi Ubah 2024-04-09 23:16:03 +02:00 committed by GitHub
parent 8dd213cff2
commit 127be97369
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 129 additions and 46 deletions

View file

@ -1472,6 +1472,19 @@ fn parse_top() {
);
}
#[test]
fn parse_extract_custom_part() {
let sql = "SELECT EXTRACT(eod FROM d)";
let select = snowflake_and_generic().verified_only_select(sql);
assert_eq!(
&Expr::Extract {
field: DateTimeField::Custom(Ident::new("eod")),
expr: Box::new(Expr::Identifier(Ident::new("d"))),
},
expr_from_projection(only(&select.projection)),
);
}
#[test]
fn parse_comma_outer_join() {
// compound identifiers