Skip to content

Commit 65e7c62

Browse files
committed
Support QUALIFY clause in Redshift
Fixes #866
1 parent bbb7df2 commit 65e7c62

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/languages/redshift/redshift.formatter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const reservedClauses = expandPhrases([
1212
'WHERE',
1313
'GROUP BY',
1414
'HAVING',
15+
'QUALIFY',
1516
'PARTITION BY',
1617
'ORDER BY',
1718
'LIMIT',

test/redshift.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,15 @@ describe('RedshiftFormatter', () => {
146146
ENCODE my_encoding;
147147
`);
148148
});
149+
150+
it('supports QUALIFY clause', () => {
151+
expect(format(`SELECT * FROM tbl QUALIFY ROW_NUMBER() OVER my_window = 1`)).toBe(dedent`
152+
SELECT
153+
*
154+
FROM
155+
tbl
156+
QUALIFY
157+
ROW_NUMBER() OVER my_window = 1
158+
`);
159+
});
149160
});

0 commit comments

Comments
 (0)