Search in sources :

Example 1 with RecursiveTableProcessor

use of org.teiid.query.tempdata.TempTableStore.RecursiveTableProcessor in project teiid by teiid.

the class RelationalPlan method open.

@Override
public void open() throws TeiidComponentException, TeiidProcessingException {
    if (with != null && tempTableStore.getProcessors() == null) {
        HashMap<String, TableProcessor> processors = new HashMap<String, TableProcessor>();
        tempTableStore.setProcessors(processors);
        for (WithQueryCommand withCommand : this.with) {
            if (withCommand.isRecursive()) {
                SetQuery setQuery = (SetQuery) withCommand.getCommand();
                ProcessorPlan initial = setQuery.getLeftQuery().getProcessorPlan();
                QueryProcessor withProcessor = new QueryProcessor(initial, getContext().clone(), root.getBufferManager(), root.getDataManager());
                processors.put(withCommand.getGroupSymbol().getName(), new RecursiveTableProcessor(withProcessor, withCommand.getColumns(), setQuery.getRightQuery().getProcessorPlan(), setQuery.isAll()));
                continue;
            }
            ProcessorPlan plan = withCommand.getCommand().getProcessorPlan();
            QueryProcessor withProcessor = new QueryProcessor(plan, getContext().clone(), root.getBufferManager(), root.getDataManager());
            processors.put(withCommand.getGroupSymbol().getName(), new TableProcessor(withProcessor, withCommand.getColumns()));
        }
    }
    this.root.open();
}
Also used : SetQuery(org.teiid.query.sql.lang.SetQuery) HashMap(java.util.HashMap) RecursiveTableProcessor(org.teiid.query.tempdata.TempTableStore.RecursiveTableProcessor) TableProcessor(org.teiid.query.tempdata.TempTableStore.TableProcessor) WithQueryCommand(org.teiid.query.sql.lang.WithQueryCommand) ProcessorPlan(org.teiid.query.processor.ProcessorPlan) QueryProcessor(org.teiid.query.processor.QueryProcessor) RecursiveTableProcessor(org.teiid.query.tempdata.TempTableStore.RecursiveTableProcessor)

Aggregations

HashMap (java.util.HashMap)1 ProcessorPlan (org.teiid.query.processor.ProcessorPlan)1 QueryProcessor (org.teiid.query.processor.QueryProcessor)1 SetQuery (org.teiid.query.sql.lang.SetQuery)1 WithQueryCommand (org.teiid.query.sql.lang.WithQueryCommand)1 RecursiveTableProcessor (org.teiid.query.tempdata.TempTableStore.RecursiveTableProcessor)1 TableProcessor (org.teiid.query.tempdata.TempTableStore.TableProcessor)1