diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-10 06:44:54 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-10 06:44:54 +0000 |
commit | d2e9401b18925b5702c5c758af7d4f5b61deb493 (patch) | |
tree | 58dbf490c0457c2908751b3e4b63af13287381ee /sqlglot/dialects/redshift.py | |
parent | Adding upstream version 11.7.1. (diff) | |
download | sqlglot-upstream/12.2.0.tar.xz sqlglot-upstream/12.2.0.zip |
Adding upstream version 12.2.0.upstream/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.py | 4 |
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)})", } |