Skip to content

Commit 3a28ffa

Browse files
romanbRoman Borschel
andauthored
Enable Redshift support for specifying null treatment inside window function (#2293)
Co-authored-by: Roman Borschel <roman@cluvio.com>
1 parent aa43c25 commit 3a28ffa

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/dialect/redshift.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,8 @@ impl Dialect for RedshiftSqlDialect {
156156
fn supports_string_literal_concatenation_with_newline(&self) -> bool {
157157
true
158158
}
159+
160+
fn supports_window_function_null_treatment_arg(&self) -> bool {
161+
true
162+
}
159163
}

tests/sqlparser_redshift.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,3 +511,9 @@ fn test_create_table_backup() {
511511
"CREATE TABLE public.users_backup_test BACKUP YES DISTSTYLE AUTO AS SELECT id, name, email FROM public.users",
512512
);
513513
}
514+
515+
#[test]
516+
fn test_null_treatment_inside_and_outside_window_function() {
517+
redshift().verified_stmt("SELECT FIRST_VALUE(1 IGNORE NULLS) OVER () FROM (SELECT 1) t");
518+
redshift().verified_stmt("SELECT FIRST_VALUE(1) IGNORE NULLS OVER () FROM (SELECT 1) t");
519+
}

0 commit comments

Comments
 (0)