ankitsultana commented on code in PR #16627:
URL: https://github.com/apache/pinot/pull/16627#discussion_r2283915768
##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/physical/v2/opt/rules/WorkerExchangeAssignmentRule.java:
##########
@@ -93,22 +93,25 @@ public PRelNode executeInternal(PRelNode currentNode,
@Nullable PRelNode parent)
return currentNode;
}
if (currentNode.getPRelInputs().isEmpty()) {
- return processCurrentNode(currentNode, parent);
+ return processCurrentNode(currentNode, parent, true);
}
if (currentNode.getPRelInputs().size() == 1) {
List<PRelNode> newInputs =
List.of(executeInternal(currentNode.getPRelInput(0), currentNode));
currentNode = currentNode.with(newInputs);
- return processCurrentNode(currentNode, parent);
+ return processCurrentNode(currentNode, parent, true);
}
// Process first input.
List<PRelNode> newInputs = new ArrayList<>();
newInputs.add(executeInternal(currentNode.getPRelInput(0), currentNode));
newInputs.addAll(currentNode.getPRelInputs().subList(1,
currentNode.getPRelInputs().size()));
currentNode = currentNode.with(newInputs);
- // Process current node.
- currentNode = processCurrentNode(currentNode, parent);
+ // Process current node. For SetOp, we don't meet dist/collation traits
immediately. This is because all inputs
+ // of a SetOp need to be processed before we can infer any Dist trait
(specifically Hash).
+ boolean meetConstraints = !(currentNode.unwrap() instanceof SetOp);
+ currentNode = processCurrentNode(currentNode, parent, meetConstraints);
// Process remaining inputs.
if (currentNode instanceof PhysicalExchange) {
+ Preconditions.checkState(meetConstraints, "PhysicalExchange should not
be created constraints were skipped");
Review Comment:
Code structure is not the greatest right now. I'll likely have to refactor
this slightly over the next 2-3 weeks as I am working on the last remaining set
of features in my roadmap (see Future Work in PR description).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]