LinkedList<OptimizerRule> ruleStack ) {
// For each of the JOIN nodes ...
for (PlanNode joinNode : plan.findAllAtOrBelow(Type.JOIN)) {
if (JoinType.RIGHT_OUTER == joinNode.getProperty(Property.JOIN_TYPE, JoinType.class)) {
// Swap the information ...
PlanNode left = joinNode.getFirstChild();
left.removeFromParent(); // right is now the first child ...
left.setParent(joinNode);
joinNode.setProperty(Property.JOIN_TYPE, JoinType.LEFT_OUTER);
// The JoinCondition and Constraints don't need to be changed
}
}
return plan;