You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/02/22 07:17:00 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #2957: implement the planner for set operation

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org