-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor: Add sql test for UNION
/ UNION ALL
+ plans
#7787
Conversation
|
||
# Plan is unnested | ||
query TT | ||
EXPLAIN SELECT name FROM t1 UNION ALL (SELECT name from t2 UNION ALL SELECT name || '_new' from t2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps I'm wrong but why we have 2 set of AggregateExecs....
I ran the similar query in PG
EXPLAIN verbose SELECT firstname FROM scientist UNION (SELECT firstname from scientist UNION SELECT firstname || '_new' from scientist2);
QUERY PLAN
--
HashAggregate (cost=44.45..49.55 rows=510 width=32)
Output: scientist.firstname
Group Key: scientist.firstname
-> Append (cost=0.00..43.17 rows=510 width=32)
-> Seq Scan on public.scientist (cost=0.00..11.70 rows=170 width=218)
Output: scientist.firstname
-> Seq Scan on public.scientist scientist_1 (cost=0.00..11.70 rows=170 width=218)
Output: scientist_1.firstname
-> Subquery Scan on "*SELECT* 3" (cost=0.00..13.82 rows=170 width=32)
Output: "*SELECT* 3"."?column?"
-> Seq Scan on public.scientist2 (cost=0.00..12.12 rows=170 width=32)
Output: ((scientist2.firstname)::text \|\| '_new'::text)
There is only 1 set of agregation
Because we haven't implemented #7786 yet :) Though it appears that @maruschin is working on it in #7788 |
Thanks @comphead and @jackwener |
Which issue does this PR close?
Related to #7695 and #7786
Rationale for this change
Add test for #7786 as well as an end to end verification for #7695
What changes are included in this PR?
2 new tests
Are these changes tested?
Are there any user-facing changes?