/** * Ensure the temp table is ready for use. If a temp table other than the one * passed in is returned it should be used instead. * @param tempTable * @param context * @param bufferManager * @param dataMgr * @throws TeiidComponentException * @throws TeiidProcessingException */ public TempTable process(TempTable tempTable) throws TeiidComponentException, TeiidProcessingException { if (!tempTable.getColumnMap().keySet().containsAll(columns)) { //sanity check to make sure that we haven't inappropriately redefined the common table throw new TeiidComponentException("failed to plan common table appropriately " + columns + " " + tempTable.getColumns()); //$NON-NLS-1$ //$NON-NLS-2$ } tempTable.insert(iterator, columns, false, false, null); tempTable.setUpdatable(false); tempTable.setAllowImplicitIndexing(true); close(); return tempTable; }
TableProcessor withProcessor = processors.get(tempTableID); if (withProcessor != null) { TempTable tt = withProcessor.process(tempTable); if (tt != tempTable) { return tt; create.setTable(new GroupSymbol(tempTableID)); create.setElementSymbolsAsColumns(withProcessor.columns); withProcessor.alterCreate(create); tempTable = addTempTable(tempTableID, create, buffer, true, context); TempTable tt = withProcessor.process(tempTable); if (tt != tempTable) { return tt;
TableProcessor withProcessor = processors.get(tempTableID); if (withProcessor != null) { TempTable tt = withProcessor.process(tempTable); if (tt != tempTable) { return tt; create.setTable(new GroupSymbol(tempTableID)); create.setElementSymbolsAsColumns(withProcessor.columns); withProcessor.alterCreate(create); tempTable = addTempTable(tempTableID, create, buffer, true, context); TempTable tt = withProcessor.process(tempTable); if (tt != tempTable) { return tt;
TableProcessor withProcessor = processors.get(tempTableID); if (withProcessor != null) { TempTable tt = withProcessor.process(tempTable); if (tt != tempTable) { return tt; create.setTable(new GroupSymbol(tempTableID)); create.setElementSymbolsAsColumns(withProcessor.columns); withProcessor.alterCreate(create); tempTable = addTempTable(tempTableID, create, buffer, true, context); TempTable tt = withProcessor.process(tempTable); if (tt != tempTable) { return tt;
@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(); }
@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(); }
@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(); }
/** * Ensure the temp table is ready for use. If a temp table other than the one * passed in is returned it should be used instead. * @param tempTable * @param context * @param bufferManager * @param dataMgr * @throws TeiidComponentException * @throws TeiidProcessingException */ public TempTable process(TempTable tempTable) throws TeiidComponentException, TeiidProcessingException { if (!tempTable.getColumnMap().keySet().containsAll(columns)) { //sanity check to make sure that we haven't inappropriately redefined the common table throw new TeiidComponentException("failed to plan common table appropriately " + columns + " " + tempTable.getColumns()); //$NON-NLS-1$ //$NON-NLS-2$ } tempTable.insert(iterator, columns, false, false, null); tempTable.setUpdatable(false); tempTable.setAllowImplicitIndexing(true); close(); return tempTable; }
/** * Ensure the temp table is ready for use. If a temp table other than the one * passed in is returned it should be used instead. * @param tempTable * @param context * @param bufferManager * @param dataMgr * @throws TeiidComponentException * @throws TeiidProcessingException */ public TempTable process(TempTable tempTable) throws TeiidComponentException, TeiidProcessingException { if (!tempTable.getColumnMap().keySet().containsAll(columns)) { //sanity check to make sure that we haven't inappropriately redefined the common table throw new TeiidComponentException("failed to plan common table appropriately " + columns + " " + tempTable.getColumns()); //$NON-NLS-1$ //$NON-NLS-2$ } tempTable.insert(iterator, columns, false, false, null); tempTable.setUpdatable(false); close(); return tempTable; }
@Override public void close() { super.close(); if (workingQp != null) { workingQp.closeProcessing(); } if (working != null) { working.remove(); } if (intermediate != null) { intermediate.remove(); } } }
public void close() throws TeiidComponentException { if (this.tempTableStore != null) { this.tempTableStore.removeTempTables(); if (this.tempTableStore.getProcessors() != null) { for (TableProcessor proc : this.tempTableStore.getProcessors().values()) { proc.close(); } this.tempTableStore.setProcessors(null); } } this.root.close(); }
public void close() throws TeiidComponentException { if (this.tempTableStore != null) { this.tempTableStore.removeTempTables(); if (this.tempTableStore.getProcessors() != null) { for (TableProcessor proc : this.tempTableStore.getProcessors().values()) { proc.close(); } this.tempTableStore.setProcessors(null); } } this.root.close(); }
@Override public void close() { super.close(); if (workingQp != null) { workingQp.closeProcessing(); } if (working != null) { working.remove(); } if (intermediate != null) { intermediate.remove(); } } }
@Override public void close() { super.close(); if (workingQp != null) { workingQp.closeProcessing(); } if (working != null) { working.remove(); } if (intermediate != null) { intermediate.remove(); } } }
public void close() throws TeiidComponentException { if (this.tempTableStore != null) { this.tempTableStore.removeTempTables(); if (this.tempTableStore.getProcessors() != null) { for (TableProcessor proc : this.tempTableStore.getProcessors().values()) { proc.close(); } this.tempTableStore.setProcessors(null); } } this.root.close(); }