summaryrefslogtreecommitdiffstats
path: root/sqlglot/dialects/redshift.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-10 06:44:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-10 06:44:58 +0000
commitbeba715b97dd2349e01dde9b077d2535680ebdca (patch)
tree0c54accb48c28eb54d2f48f88d149492717b30e5 /sqlglot/dialects/redshift.py
parentReleasing debian version 11.7.1-1. (diff)
downloadsqlglot-beba715b97dd2349e01dde9b077d2535680ebdca.tar.xz
sqlglot-beba715b97dd2349e01dde9b077d2535680ebdca.zip
Merging upstream version 12.2.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/redshift.py')
-rw-r--r--sqlglot/dialects/redshift.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sqlglot/dialects/redshift.py b/sqlglot/dialects/redshift.py
index a9c4f62..1b7cf31 100644
--- a/sqlglot/dialects/redshift.py
+++ b/sqlglot/dialects/redshift.py
@@ -52,6 +52,8 @@ class Redshift(Postgres):
return this
class Tokenizer(Postgres.Tokenizer):
+ BIT_STRINGS = []
+ HEX_STRINGS = []
STRING_ESCAPES = ["\\"]
KEYWORDS = {
@@ -90,7 +92,6 @@ class Redshift(Postgres):
TRANSFORMS = {
**Postgres.Generator.TRANSFORMS, # type: ignore
- **transforms.ELIMINATE_DISTINCT_ON, # type: ignore
exp.CurrentTimestamp: lambda self, e: "SYSDATE",
exp.DateAdd: lambda self, e: self.func(
"DATEADD", exp.var(e.text("unit") or "day"), e.expression, e.this
@@ -102,6 +103,7 @@ class Redshift(Postgres):
exp.DistStyleProperty: lambda self, e: self.naked_property(e),
exp.JSONExtract: _json_sql,
exp.JSONExtractScalar: _json_sql,
+ exp.Select: transforms.preprocess([transforms.eliminate_distinct_on]),
exp.SortKeyProperty: lambda self, e: f"{'COMPOUND ' if e.args['compound'] else ''}SORTKEY({self.format_args(*e.this)})",
}