diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-30 08:03:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-30 08:03:55 +0000 |
commit | 5510bab2f2724b1785efb5e4be0e4fa1e0afbf9e (patch) | |
tree | 8f11dc162604c83298116ce6ac23d64492e2c189 /sqlglot/dialects/bigquery.py | |
parent | Adding upstream version 16.7.3. (diff) | |
download | sqlglot-5510bab2f2724b1785efb5e4be0e4fa1e0afbf9e.tar.xz sqlglot-5510bab2f2724b1785efb5e4be0e4fa1e0afbf9e.zip |
Adding upstream version 16.7.7.upstream/16.7.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/bigquery.py')
-rw-r--r-- | sqlglot/dialects/bigquery.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sqlglot/dialects/bigquery.py b/sqlglot/dialects/bigquery.py index 8786063..c9d6c79 100644 --- a/sqlglot/dialects/bigquery.py +++ b/sqlglot/dialects/bigquery.py @@ -96,13 +96,14 @@ def _unqualify_unnest(expression: exp.Expression) -> exp.Expression: These are added by the optimizer's qualify_column step. """ + from sqlglot.optimizer.scope import Scope + if isinstance(expression, exp.Select): for unnest in expression.find_all(exp.Unnest): if isinstance(unnest.parent, (exp.From, exp.Join)) and unnest.alias: - for select in expression.selects: - for column in select.find_all(exp.Column): - if column.table == unnest.alias: - column.set("table", None) + for column in Scope(expression).find_all(exp.Column): + if column.table == unnest.alias: + column.set("table", None) return expression |