nullSuppliers.add(leftTableName);
nullSuppliers.add(rightTableName);
// verify that these null suppliers are indeed in the left and right sets
if (!rightTableSet.contains(nullSuppliers.get(0)) && !leftTableSet.contains(nullSuppliers.get(0))) {
throw new InvalidQueryException("Incorrect Logical Query Plan with regard to outer join");
}
if (!rightTableSet.contains(nullSuppliers.get(1)) && !leftTableSet.contains(nullSuppliers.get(1))) {
throw new InvalidQueryException("Incorrect Logical Query Plan with regard to outer join");
}
} else if (joinType == JoinType.LEFT_OUTER) {
nullSuppliers.add(((RelationNode)joinNode.getRightChild()).getCanonicalName());
//verify that this null supplier is indeed in the right sub-tree
if (!rightTableSet.contains(nullSuppliers.get(0))) {
throw new InvalidQueryException("Incorrect Logical Query Plan with regard to outer join");
}
} else if (joinType == JoinType.RIGHT_OUTER) {
if (((RelationNode)joinNode.getRightChild()).getCanonicalName().equals(rightTableName)) {
nullSuppliers.add(leftTableName);
} else {
nullSuppliers.add(rightTableName);
}
// verify that this null supplier is indeed in the left sub-tree
if (!leftTableSet.contains(nullSuppliers.get(0))) {
throw new InvalidQueryException("Incorrect Logical Query Plan with regard to outer join");
}
}
// retain in this outer join node's JoinQual those selection predicates
// related to the outer join's null supplier(s)