extract operator: add support for Postgres keywords (#427)

Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
This commit is contained in:
Maciej Obuchowski 2022-03-07 16:03:28 +01:00 committed by GitHub
parent 0d1c5d1205
commit 3af3ca07b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 88 additions and 0 deletions

View file

@ -1388,6 +1388,21 @@ fn parse_extract() {
verified_stmt("SELECT EXTRACT(HOUR FROM d)");
verified_stmt("SELECT EXTRACT(MINUTE FROM d)");
verified_stmt("SELECT EXTRACT(SECOND FROM d)");
verified_stmt("SELECT EXTRACT(CENTURY FROM d)");
verified_stmt("SELECT EXTRACT(DECADE FROM d)");
verified_stmt("SELECT EXTRACT(DOW FROM d)");
verified_stmt("SELECT EXTRACT(DOY FROM d)");
verified_stmt("SELECT EXTRACT(EPOCH FROM d)");
verified_stmt("SELECT EXTRACT(ISODOW FROM d)");
verified_stmt("SELECT EXTRACT(ISOYEAR FROM d)");
verified_stmt("SELECT EXTRACT(JULIAN FROM d)");
verified_stmt("SELECT EXTRACT(MICROSECONDS FROM d)");
verified_stmt("SELECT EXTRACT(MILLENIUM FROM d)");
verified_stmt("SELECT EXTRACT(MILLISECONDS FROM d)");
verified_stmt("SELECT EXTRACT(QUARTER FROM d)");
verified_stmt("SELECT EXTRACT(TIMEZONE FROM d)");
verified_stmt("SELECT EXTRACT(TIMEZONE_HOUR FROM d)");
verified_stmt("SELECT EXTRACT(TIMEZONE_MINUTE FROM d)");
let res = parse_sql_statements("SELECT EXTRACT(MILLISECOND FROM d)");
assert_eq!(