summaryrefslogtreecommitdiffstats
path: root/sqlglot/dialects/redshift.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-29 13:02:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-29 13:02:29 +0000
commit9b39dac84e82bf473216939e50b8836170f01d23 (patch)
tree9b405bc86ef7e2ea28cddc6b787ed70355cf7fce /sqlglot/dialects/redshift.py
parentReleasing debian version 16.4.2-1. (diff)
downloadsqlglot-9b39dac84e82bf473216939e50b8836170f01d23.tar.xz
sqlglot-9b39dac84e82bf473216939e50b8836170f01d23.zip
Merging upstream version 16.7.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/redshift.py')
-rw-r--r--sqlglot/dialects/redshift.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/sqlglot/dialects/redshift.py b/sqlglot/dialects/redshift.py
index db6cc3f..87be42c 100644
--- a/sqlglot/dialects/redshift.py
+++ b/sqlglot/dialects/redshift.py
@@ -41,8 +41,6 @@ class Redshift(Postgres):
"STRTOL": exp.FromBase.from_arg_list,
}
- CONVERT_TYPE_FIRST = True
-
def _parse_types(
self, check_func: bool = False, schema: bool = False
) -> t.Optional[exp.Expression]:
@@ -58,6 +56,12 @@ class Redshift(Postgres):
return this
+ def _parse_convert(self, strict: bool) -> t.Optional[exp.Expression]:
+ to = self._parse_types()
+ self._match(TokenType.COMMA)
+ this = self._parse_bitwise()
+ return self.expression(exp.TryCast, this=this, to=to)
+
class Tokenizer(Postgres.Tokenizer):
BIT_STRINGS = []
HEX_STRINGS = []