private void resetPlan() { plan.reset(); isOpen = false; needsProcessing = false; }
private void resetPlan() { plan.reset(); isOpen = false; needsProcessing = false; }
private void resetPlan() { plan.reset(); isOpen = false; needsProcessing = false; }
@Override public void reset() { super.reset(); this.queryPlan.reset(); this.updateCount = 0; this.currentTuple = null; this.rowProcessor = null; this.queryProcessor = null; this.tupleSource = null; this.batchCollector = null; this.planContext = null; this.first = true; this.nextTuple = null; this.nextNull = false; }
@Override public void reset() { super.reset(); this.queryPlan.reset(); this.updateCount = 0; this.currentTuple = null; this.rowProcessor = null; this.queryProcessor = null; this.tupleSource = null; this.batchCollector = null; this.planContext = null; this.first = true; this.nextTuple = null; this.nextNull = false; }
public void reset() { for (SubqueryState subQueryState : subqueries.values()) { subQueryState.plan.reset(); subQueryState.close(true); } cache.clear(); smallCache.clear(); currentTuples = 0; if (this.functionState != null) { this.functionState.clear(); } }
public void reset() { for (SubqueryState subQueryState : subqueries.values()) { subQueryState.plan.reset(); subQueryState.close(true); } cache.clear(); smallCache.clear(); currentTuples = 0; if (this.functionState != null) { this.functionState.clear(); } }
public void reset() { for (SubqueryState subQueryState : subqueries.values()) { subQueryState.plan.reset(); subQueryState.close(true); } cache.clear(); smallCache.clear(); currentTuples = 0; if (this.functionState != null) { this.functionState.clear(); } }
/** * @see org.teiid.query.processor.ProcessorPlan#reset() */ public void reset() { super.reset(); this.root.reset(); if (this.with != null) { for (WithQueryCommand withCommand : this.with) { if (withCommand.isRecursive()) { SetQuery setQuery = (SetQuery)withCommand.getCommand(); setQuery.getLeftQuery().getProcessorPlan().reset(); setQuery.getLeftQuery().getProcessorPlan().reset(); } else { withCommand.getCommand().getProcessorPlan().reset(); } } } }
/** * @see org.teiid.query.processor.ProcessorPlan#reset() */ public void reset() { super.reset(); this.root.reset(); if (this.with != null) { for (WithQueryCommand withCommand : this.with) { if (withCommand.isRecursive()) { SetQuery setQuery = (SetQuery)withCommand.getCommand(); setQuery.getLeftQuery().getProcessorPlan().reset(); setQuery.getLeftQuery().getProcessorPlan().reset(); } else { withCommand.getCommand().getProcessorPlan().reset(); } } } }
public void reset() { super.reset(); nextBatchCount = 1; this.context = new XMLContext(); this.env = this.env.clone(); LogManager.logTrace(LogConstants.CTX_XML_PLAN, "XMLPlan reset"); //$NON-NLS-1$ }
/** * @see org.teiid.query.processor.ProcessorPlan#reset() */ public void reset() { super.reset(); this.root.reset(); if (this.with != null) { for (WithQueryCommand withCommand : this.with) { if (withCommand.isRecursive()) { SetQuery setQuery = (SetQuery)withCommand.getCommand(); setQuery.getLeftQuery().getProcessorPlan().reset(); setQuery.getLeftQuery().getProcessorPlan().reset(); } else { withCommand.getCommand().getProcessorPlan().reset(); } } } }
@Test public void testRollup() throws Exception { String sql = "select e1, sum(e2) from pm1.g1 group by rollup(e1)"; //$NON-NLS-1$ List[] expected = new List[] { Arrays.asList("a", Long.valueOf(3)), Arrays.asList("b", Long.valueOf(1)), Arrays.asList(null, Long.valueOf(4)) }; ProcessorPlan plan = helpGetPlan(sql, RealMetadataFactory.example1Cached()); HardcodedDataManager hdm = new HardcodedDataManager(); hdm.addData("SELECT pm1.g1.e1, pm1.g1.e2 FROM pm1.g1", Arrays.asList("a", 1), Arrays.asList("a", 2), Arrays.asList("b", 1)); helpProcess(plan, hdm, expected); expected = new List[] { Arrays.asList("a", Long.valueOf(4)), Arrays.asList(null, Long.valueOf(4)) }; plan.close(); plan.reset(); hdm = new HardcodedDataManager(); hdm.addData("SELECT pm1.g1.e1, pm1.g1.e2 FROM pm1.g1", Arrays.asList("a", 1), Arrays.asList("a", 3)); helpProcess(plan, hdm, expected); }
@Test public void testRollup2() throws Exception { String sql = "select e1, e2, sum(e4) from pm1.g1 group by rollup(e1, e2)"; //$NON-NLS-1$ List[] expected = new List[] { Arrays.asList("a", 1, 1.0), Arrays.asList("a", 3, 2.0), Arrays.asList("a", null, 3.0), Arrays.asList("b", 2, 3.0), Arrays.asList("b", 4, 4.0), Arrays.asList("b", null, 7.0), Arrays.asList(null, null, 10.0), }; ProcessorPlan plan = helpGetPlan(sql, RealMetadataFactory.example1Cached()); HardcodedDataManager hdm = new HardcodedDataManager(); hdm.addData("SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e4 FROM pm1.g1", Arrays.asList("a", 1, 1.0), Arrays.asList("a", 3, 2.0), Arrays.asList("b", 2, 3.0), Arrays.asList("b", 4, 4.0)); helpProcess(plan, hdm, expected); plan.close(); plan.reset(); //an empty rollup should produce no rows hdm = new HardcodedDataManager(); hdm.addData("SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e4 FROM pm1.g1"); helpProcess(plan, hdm, new List<?>[0]); }
public static void helpProcess(ProcessorPlan plan, CommandContext context, ProcessorDataManager dataManager, List[] expectedResults) throws Exception { ProcessorPlan clonePlan = plan.clone(); // Process twice to test reset and clone doProcess(plan, dataManager, expectedResults, context); plan.reset(); doProcess(plan, dataManager, expectedResults, context); // Execute cloned of original plan doProcess(clonePlan, dataManager, expectedResults, context); }
private void openPlan() throws TeiidComponentException, TeiidProcessingException { //reset prior to updating the context updatePlans[planIndex].reset(); if (this.contexts != null && !this.contexts.isEmpty()) { CommandContext context = updatePlans[planIndex].getContext(); VariableContext vc = context.getVariableContext(); //ensure that we're dealing with the global context //this is just a safe guard against the plan not correctly resetting the context while (vc.getParentContext() != null) { vc = vc.getParentContext(); } vc.clear(); VariableContext currentValues = this.contexts.get(planIndex); vc.putAll(currentValues); } TransactionContext tc = this.getContext().getTransactionContext(); if (startTxn[planIndex] && tc != null && tc.getTransactionType() == Scope.NONE) { this.getContext().getTransactionServer().begin(tc); this.planContexts[planIndex] = tc; } updatePlans[planIndex].open(); planOpened[planIndex] = true; }