gortiz commented on code in PR #14495:
URL: https://github.com/apache/pinot/pull/14495#discussion_r1850244343


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/plannode/MailboxSendNode.java:
##########
@@ -50,8 +53,42 @@ public MailboxSendNode(int stageId, DataSchema dataSchema, 
List<PlanNode> inputs
     _sort = sort;
   }
 
+  public MailboxSendNode(int stageId, DataSchema dataSchema, List<PlanNode> 
inputs,
+      int receiverStage, PinotRelExchangeType exchangeType,
+      RelDistribution.Type distributionType, @Nullable List<Integer> keys, 
boolean prePartitioned,
+      @Nullable List<RelFieldCollation> collations, boolean sort) {
+    this(stageId, dataSchema, inputs, toBitSet(receiverStage), exchangeType, 
distributionType, keys, prePartitioned,
+        collations, sort);
+  }
+
+  private static BitSet toBitSet(int receiverStage) {
+    BitSet bitSet = new BitSet(receiverStage + 1);
+    bitSet.set(receiverStage);
+    return bitSet;
+  }
+
+  public MailboxSendNode(int stageId, DataSchema dataSchema, List<PlanNode> 
inputs,
+      PinotRelExchangeType exchangeType, RelDistribution.Type 
distributionType, @Nullable List<Integer> keys,
+      boolean prePartitioned, @Nullable List<RelFieldCollation> collations, 
boolean sort) {
+    this(stageId, dataSchema, inputs, null, exchangeType, distributionType, 
keys, prePartitioned, collations, sort);
+  }
+
+  public BitSet getReceiverStages() {
+    Preconditions.checkState(!_receiverStages.isEmpty(), "Receivers not set");
+    return (BitSet) _receiverStages.clone();
+  }

Review Comment:
   I'm not a fan of leaking these constraints, even if we document it.
   
   In the next PR (spools actually used in queries) I changed this code to 
return a `clone()`. I can apply this change in this PR as well.



-- 
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-unsubscr...@pinot.apache.org

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


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

Reply via email to