added = false;
Set<SelectorName> viewNames = new HashSet<SelectorName>(definitions.keySet());
for (SelectorName name : viewNames) {
QueryCommand command = definitions.get(name);
// Create the canonical plan for the definition ...
QueryContext queryContext = new QueryContext(schemata, typeSystem);
CanonicalPlanner planner = new CanonicalPlanner();
PlanNode plan = planner.createPlan(queryContext, command);
if (queryContext.getProblems().hasErrors()) {
continue;
}
// Get the columns from the top-level PROJECT ...
PlanNode project = plan.findAtOrBelow(Type.PROJECT);