-
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
Include ALL modifier for set operators in multi-stage query engine physical explain plan #13166
Conversation
…ysical explain plan
0e104a6
to
dd67957
Compare
@@ -57,7 +57,7 @@ public boolean isAll() { | |||
|
|||
@Override | |||
public String explain() { | |||
return _setOpType.toString(); | |||
return _all ? _setOpType.toString() + "_ALL" : _setOpType.toString(); |
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.
Does it works in Union
? AFAIR union always behaves as all = true
. Is this attribute always true in union
?
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.
Yeah it does look like this attribute is always true for the union set operation (i.e., regardless of whether we use UNION
or UNION ALL
). I guess that isn't inaccurate though since the actual semantics being implemented are indeed the UNION ALL
semantics and the logical plan also contains LogicalUnion(all=[true])
for both UNION
and UNION ALL
?
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.
Ah, I just noticed that the query plan for UNION
contains an aggregation on top to only get unique values from the result of the UNION ALL
, interesting.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #13166 +/- ##
============================================
+ Coverage 61.75% 62.15% +0.40%
+ Complexity 207 198 -9
============================================
Files 2436 2517 +81
Lines 133233 137895 +4662
Branches 20636 21340 +704
============================================
+ Hits 82274 85713 +3439
- Misses 44911 45798 +887
- Partials 6048 6384 +336
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…ysical explain plan (apache#13166)
INTERSECT ALL
andEXCEPT ALL
set operators in the multi-stage query engine.ALL
modifier was used.EXPLAIN PLAN FOR SELECT * FROM (SELECT a FROM A) EXCEPT ALL (SELECT b FROM B);
looks like this (Calcite syntax):ALL
modifier was used. So the output for bothEXPLAIN IMPLEMENTATION PLAN FOR SELECT * FROM (SELECT a FROM A) EXCEPT ALL (SELECT b FROM B);
andEXPLAIN IMPLEMENTATION PLAN FOR SELECT * FROM (SELECT a FROM A) EXCEPT (SELECT b FROM B);
would look the same:SetOpNode::explain
which is called in thePhysicalExplainPlanVisitor
here. The output forEXPLAIN IMPLEMENTATION PLAN FOR SELECT * FROM (SELECT a FROM A) EXCEPT ALL (SELECT b FROM B);
now looks like: