morningman commented on a change in pull request #2957: implement the planner
for set operation
URL: https://github.com/apache/incubator-doris/pull/2957#discussion_r382893199
##########
File path: fe/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
##########
@@ -1590,16 +1619,46 @@ private PlanNode
createSetOperationPlan(SetOperationStmt setOperationStmt, Analy
setOperationStmt.materializeRequiredSlots(analyzer);
PlanNode result = null;
- // create DISTINCT tree
- if (setOperationStmt.hasDistinctOps()) {
- result = createUnionPlan(
- analyzer, setOperationStmt,
setOperationStmt.getDistinctOperands(), null, defaultOrderByLimit);
- result = new AggregationNode(ctx_.getNextNodeId(), result,
setOperationStmt.getDistinctAggInfo());
- result.init(analyzer);
+ SetOperationStmt.Operation operation = null;
+ SetOperationStmt.Qualifier exceptQualifier = null;
+ List<SetOperationStmt.SetOperand> partialOperands = new ArrayList<>();
+ // create plan for a union b intersect c except b to three fragments
+ // 3:[2:[1:[a union b] intersect c] except c]
+ // EXCEPT operator is NOT commutative, it IS important which query is
first,
+ // which second using EXCEPT operator, so EXCEPT operator cannot merge
all distinct op to one node all all
+ // op to another node
Review comment:
Could you add more comment to explain the logic here?
And better to add Unit test to test it. You can reference to bitmap function
test.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]