use of org.teiid.query.sql.lang.WithQueryCommand in project teiid by teiid.
the class RelationalPlan method clone.
public RelationalPlan clone() {
RelationalPlan plan = new RelationalPlan((RelationalNode) root.clone());
plan.setOutputElements(outputCols);
if (with != null) {
List<WithQueryCommand> newWith = LanguageObject.Util.deepClone(this.with, WithQueryCommand.class);
for (WithQueryCommand withQueryCommand : newWith) {
if (withQueryCommand.isRecursive()) {
SetQuery setQuery = (SetQuery) withQueryCommand.getCommand();
setQuery.getLeftQuery().setProcessorPlan(setQuery.getLeftQuery().getProcessorPlan().clone());
setQuery.getRightQuery().setProcessorPlan(setQuery.getRightQuery().getProcessorPlan().clone());
} else {
withQueryCommand.getCommand().setProcessorPlan(withQueryCommand.getCommand().getProcessorPlan().clone());
}
}
plan.setWith(newWith);
}
return plan;
}
Aggregations