summaryrefslogtreecommitdiffstats
path: root/sqlglot/optimizer/eliminate_joins.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-14 05:43:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-14 05:43:02 +0000
commitc8d4d4ead5df1c84966431eec8b88e974414dafc (patch)
tree847e292ab98fe79a3a78cd6797b564b73f4d2681 /sqlglot/optimizer/eliminate_joins.py
parentReleasing debian version 17.3.0-1. (diff)
downloadsqlglot-c8d4d4ead5df1c84966431eec8b88e974414dafc.tar.xz
sqlglot-c8d4d4ead5df1c84966431eec8b88e974414dafc.zip
Merging upstream version 17.4.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/optimizer/eliminate_joins.py')
-rw-r--r--sqlglot/optimizer/eliminate_joins.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sqlglot/optimizer/eliminate_joins.py b/sqlglot/optimizer/eliminate_joins.py
index cd8ba3b..3134e65 100644
--- a/sqlglot/optimizer/eliminate_joins.py
+++ b/sqlglot/optimizer/eliminate_joins.py
@@ -85,7 +85,7 @@ def _unique_outputs(scope):
grouped_outputs = set()
unique_outputs = set()
- for select in scope.selects:
+ for select in scope.expression.selects:
output = select.unalias()
if output in grouped_expressions:
grouped_outputs.add(output)
@@ -105,7 +105,7 @@ def _unique_outputs(scope):
def _has_single_output_row(scope):
return isinstance(scope.expression, exp.Select) and (
- all(isinstance(e.unalias(), exp.AggFunc) for e in scope.selects)
+ all(isinstance(e.unalias(), exp.AggFunc) for e in scope.expression.selects)
or _is_limit_1(scope)
or not scope.expression.args.get("from")
)