diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-02-16 05:45:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-02-16 05:45:52 +0000 |
commit | 3d48060515ba25b4c49d975a520ee0682327d1b7 (patch) | |
tree | e8730f509026e866d77c459f74a384505425363a /sqlglot/dialects/redshift.py | |
parent | Releasing debian version 21.0.2-1. (diff) | |
download | sqlglot-3d48060515ba25b4c49d975a520ee0682327d1b7.tar.xz sqlglot-3d48060515ba25b4c49d975a520ee0682327d1b7.zip |
Merging upstream version 21.1.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/redshift.py')
-rw-r--r-- | sqlglot/dialects/redshift.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sqlglot/dialects/redshift.py b/sqlglot/dialects/redshift.py index a64c1d4..135ffc6 100644 --- a/sqlglot/dialects/redshift.py +++ b/sqlglot/dialects/redshift.py @@ -136,11 +136,11 @@ class Redshift(Postgres): refs.add( ( this.args["from"] if i == 0 else this.args["joins"][i - 1] - ).alias_or_name.lower() + ).this.alias.lower() ) - table = join.this - if isinstance(table, exp.Table): + table = join.this + if isinstance(table, exp.Table) and not join.args.get("on"): if table.parts[0].name.lower() in refs: table.replace(table.to_column()) return this @@ -158,6 +158,7 @@ class Redshift(Postgres): "UNLOAD": TokenType.COMMAND, "VARBYTE": TokenType.VARBINARY, } + KEYWORDS.pop("VALUES") # Redshift allows # to appear as a table identifier prefix SINGLE_TOKENS = Postgres.Tokenizer.SINGLE_TOKENS.copy() |