Skip to content

Commit

Permalink
Fix(redshift): don't transform multi-arg DISTINCT clause (#3079)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgesittas committed Mar 4, 2024
1 parent 3d263aa commit 0ebce40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions sqlglot/dialects/redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class Generator(Postgres.Generator):
NVL2_SUPPORTED = True
LAST_DAY_SUPPORTS_DATE_PART = False
CAN_IMPLEMENT_ARRAY_ANY = False
MULTI_ARG_DISTINCT = True

TYPE_MAPPING = {
**Postgres.Generator.TYPE_MAPPING,
Expand Down
1 change: 1 addition & 0 deletions tests/dialects/test_redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ def test_redshift(self):
)

def test_identity(self):
self.validate_identity("LISTAGG(DISTINCT foo, ', ')")
self.validate_identity("CREATE MATERIALIZED VIEW orders AUTO REFRESH YES AS SELECT 1")
self.validate_identity("SELECT DATEADD(DAY, 1, 'today')")
self.validate_identity("SELECT * FROM #x")
Expand Down

0 comments on commit 0ebce40

Please sign in to comment.