You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "xiangfu0 (via GitHub)" <gi...@apache.org> on 2023/05/03 09:27:33 UTC

[GitHub] [pinot] xiangfu0 commented on a diff in pull request #10622: [multistage] UNION/INTERSECT/EXCEPT implementation

xiangfu0 commented on code in PR #10622:
URL: https://github.com/apache/pinot/pull/10622#discussion_r1183448020


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/plan/PhysicalPlanVisitor.java:
##########
@@ -105,8 +110,24 @@ public MultiStageOperator visitWindow(WindowNode node, PlanRequestContext contex
 
   @Override
   public MultiStageOperator visitSetOp(SetOpNode setOpNode, PlanRequestContext context) {
-    throw new UnsupportedOperationException(
-        "Stage node of type SetOpNode: " + setOpNode.getSetOpType() + " is not supported!");
+    List<MultiStageOperator> inputs = new ArrayList<>();
+    for (StageNode input : setOpNode.getInputs()) {
+      MultiStageOperator visited = input.visit(this, context);
+      inputs.add(visited);
+    }
+    switch (setOpNode.getSetOpType()) {
+      case UNION:
+        return new UnionOperator(context.getOpChainExecutionContext(), inputs,
+            setOpNode.getInputs().get(0).getDataSchema());

Review Comment:
   For now UNION is parsed to UNION ALL + DISTINCT, so for UNION, all is always true.
   For INTERSECT and MINUS, the all is always false.
   
   We can support it the check for all later if parser side can support it.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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