public void process(ProcedurePlan procEnv) throws TeiidComponentException { List<?> currentRow = procEnv.getCurrentRow(rsName); VariableContext varContext = procEnv.getCurrentVariableContext(); //set results to the variable context(the cursor.element is treated as variable) if(this.elements == null){ List schema = procEnv.getSchema(rsName); elements = new ArrayList<ElementSymbol>(schema.size()); for(int i=0; i< schema.size(); i++){ Expression element = (Expression)schema.get(i); ElementSymbol e = new ElementSymbol(rsName + Symbol.SEPARATOR + Symbol.getShortName(element)); e.setType(element.getType()); elements.add(e); } } for(int i=0; i< elements.size(); i++){ varContext.setValue(elements.get(i), currentRow.get(i)); } }
public void process(ProcedurePlan procEnv) throws TeiidComponentException { List<?> currentRow = procEnv.getCurrentRow(rsName); VariableContext varContext = procEnv.getCurrentVariableContext(); //set results to the variable context(the cursor.element is treated as variable) if(this.elements == null){ List schema = procEnv.getSchema(rsName); elements = new ArrayList<ElementSymbol>(schema.size()); for(int i=0; i< schema.size(); i++){ Expression element = (Expression)schema.get(i); ElementSymbol e = new ElementSymbol(rsName + Symbol.SEPARATOR + Symbol.getShortName(element)); e.setType(element.getType()); elements.add(e); } } for(int i=0; i< elements.size(); i++){ varContext.setValue(elements.get(i), currentRow.get(i)); } }
public void process(ProcedurePlan procEnv) throws TeiidComponentException { List<?> currentRow = procEnv.getCurrentRow(rsName); VariableContext varContext = procEnv.getCurrentVariableContext(); //set results to the variable context(the cursor.element is treated as variable) if(this.elements == null){ List schema = procEnv.getSchema(rsName); elements = new ArrayList<ElementSymbol>(schema.size()); for(int i=0; i< schema.size(); i++){ Expression element = (Expression)schema.get(i); ElementSymbol e = new ElementSymbol(rsName + Symbol.SEPARATOR + Symbol.getShortName(element)); e.setType(element.getType()); elements.add(e); } } for(int i=0; i< elements.size(); i++){ varContext.setValue(elements.get(i), currentRow.get(i)); } }
if (this.outParams != null) { for (ElementSymbol param : this.outParams) { setParameterValue(param, getCurrentVariableContext(), null); Expression expr = entry.getValue(); VariableContext context = getCurrentVariableContext(); if (context.getVariableMap().containsKey(param)) { continue;
if (this.outParams != null) { for (ElementSymbol param : this.outParams) { setParameterValue(param, getCurrentVariableContext(), null); Expression expr = entry.getValue(); VariableContext context = getCurrentVariableContext(); if (context.getVariableMap().containsKey(param)) { continue;
if (this.outParams != null) { for (ElementSymbol param : this.outParams) { setParameterValue(param, getCurrentVariableContext(), null); Expression expr = entry.getValue(); VariableContext context = getCurrentVariableContext(); if (context.getVariableMap().containsKey(param)) { continue;
if(tuple == null) { if (outParams != null) { VariableContext vc = getCurrentVariableContext(); List<Object> paramTuple = Arrays.asList(new Object[this.getOutputElements().size()]); int i = this.getOutputElements().size() - this.outParams.size();
if(tuple == null) { if (outParams != null) { VariableContext vc = getCurrentVariableContext(); List<Object> paramTuple = Arrays.asList(new Object[this.getOutputElements().size()]); int i = this.getOutputElements().size() - this.outParams.size();
if(tuple == null) { if (outParams != null) { VariableContext vc = getCurrentVariableContext(); List<Object> paramTuple = Arrays.asList(new Object[this.getOutputElements().size()]); int i = this.getOutputElements().size() - this.outParams.size();
/** * <p> Updates the current variable context with a value for the Variable * defined using a DeclareInstruction, the variable value is obtained by either processing * a expression or a command(stored as a processplan). The Processing of the command is * expected to result in 1 column, 1 row tuple, if more than a row is returned an exception * is thrown. Also updates the program counter.</p> * @throws BlockedException * @throws TeiidComponentException if error processing command or expression on this instruction */ public void process(ProcedurePlan procEnv) throws BlockedException, TeiidComponentException, TeiidProcessingException { VariableContext varContext = procEnv.getCurrentVariableContext(); Object value = null; if (this.expression != null) { value = procEnv.evaluateExpression(this.expression); } varContext.setValue(getVariable(), value); LogManager.logTrace(LogConstants.CTX_DQP, new Object[] {this.toString() + " The variable " //$NON-NLS-1$ + getVariable() + " in the variablecontext is updated with the value :", value}); //$NON-NLS-1$ }
/** * <p> Updates the current variable context with a value for the Variable * defined using a DeclareInstruction, the variable value is obtained by either processing * a expression or a command(stored as a processplan). The Processing of the command is * expected to result in 1 column, 1 row tuple, if more than a row is returned an exception * is thrown. Also updates the program counter.</p> * @throws BlockedException * @throws TeiidComponentException if error processing command or expression on this instruction */ public void process(ProcedurePlan procEnv) throws BlockedException, TeiidComponentException, TeiidProcessingException { VariableContext varContext = procEnv.getCurrentVariableContext(); Object value = null; if (this.expression != null) { value = procEnv.evaluateExpression(this.expression); } varContext.setValue(getVariable(), value); LogManager.logTrace(LogConstants.CTX_DQP, new Object[] {this.toString() + " The variable " //$NON-NLS-1$ + getVariable() + " in the variablecontext is updated with the value :", value}); //$NON-NLS-1$ }
/** * <p> Updates the current variable context with a value for the Variable * defined using a DeclareInstruction, the variable value is obtained by either processing * a expression or a command(stored as a processplan). The Processing of the command is * expected to result in 1 column, 1 row tuple, if more than a row is returned an exception * is thrown. Also updates the program counter.</p> * @throws BlockedException * @throws TeiidComponentException if error processing command or expression on this instruction */ public void process(ProcedurePlan procEnv) throws BlockedException, TeiidComponentException, TeiidProcessingException { VariableContext varContext = procEnv.getCurrentVariableContext(); Object value = null; if (this.expression != null) { value = procEnv.evaluateExpression(this.expression); } varContext.setValue(getVariable(), value); LogManager.logTrace(LogConstants.CTX_DQP, new Object[] {this.toString() + " The variable " //$NON-NLS-1$ + getVariable() + " in the variablecontext is updated with the value :", value}); //$NON-NLS-1$ }
Integer index = this.lookupMap.get(entry.getValue()); if (index != null) { rowProcedure.getCurrentVariableContext().setValue(entry.getKey(), this.currentTuple.get(index)); } else { rowProcedure.getCurrentVariableContext().setValue(entry.getKey(), eval.evaluate(entry.getValue(), this.currentTuple)); VariableContext vc = rowProcedure.getCurrentVariableContext();
getCurrentVariableContext().setValue(entry.getValue(), DataTypeManager.transformValue(this.currentState.currentRow.get(index), entry.getValue().getType())); this.currentState.resultsBuffer.addTuple(tuple); getCurrentVariableContext().setValue(ProcedurePlan.ROWCOUNT, 0); } else if (mode == Mode.UPDATE) { List<?> t = this.currentState.ts.nextTuple(); rowCount = (Integer)t.get(0); getCurrentVariableContext().setValue(ProcedurePlan.ROWCOUNT, rowCount); return; getCurrentVariableContext().setValue(ProcedurePlan.ROWCOUNT, 0); return;
getCurrentVariableContext().setValue(entry.getValue(), DataTypeManager.transformValue(this.currentState.currentRow.get(index), entry.getValue().getType())); this.currentState.resultsBuffer.addTuple(tuple); getCurrentVariableContext().setValue(ProcedurePlan.ROWCOUNT, 0); } else if (mode == Mode.UPDATE) { List<?> t = this.currentState.ts.nextTuple(); rowCount = (Integer)t.get(0); getCurrentVariableContext().setValue(ProcedurePlan.ROWCOUNT, rowCount); return; getCurrentVariableContext().setValue(ProcedurePlan.ROWCOUNT, 0); return;
getCurrentVariableContext().setValue(entry.getValue(), DataTypeManager.transformValue(this.currentState.currentRow.get(index), entry.getValue().getType())); this.currentState.resultsBuffer.addTuple(tuple); getCurrentVariableContext().setValue(ProcedurePlan.ROWCOUNT, 0); } else if (mode == Mode.UPDATE) { List<?> t = this.currentState.ts.nextTuple(); rowCount = (Integer)t.get(0); getCurrentVariableContext().setValue(ProcedurePlan.ROWCOUNT, rowCount); return; getCurrentVariableContext().setValue(ProcedurePlan.ROWCOUNT, 0); return;
Integer index = this.lookupMap.get(entry.getValue()); if (index != null) { rowProcedure.getCurrentVariableContext().setValue(entry.getKey(), this.currentTuple.get(index)); } else { rowProcedure.getCurrentVariableContext().setValue(entry.getKey(), eval.evaluate(entry.getValue(), this.currentTuple));
Integer index = this.lookupMap.get(entry.getValue()); if (index != null) { rowProcedure.getCurrentVariableContext().setValue(entry.getKey(), this.currentTuple.get(index)); } else { rowProcedure.getCurrentVariableContext().setValue(entry.getKey(), eval.evaluate(entry.getValue(), this.currentTuple)); VariableContext vc = rowProcedure.getCurrentVariableContext();
TeiidComponentException, TeiidProcessingException { VariableContext localContext = procEnv.getCurrentVariableContext(); insert.addVariable(col); insert.addValue(new Constant(procEnv.getCurrentVariableContext().getValue(ProcedurePlan.ROWCOUNT))); QueryResolver.resolveCommand(insert, metadata.getDesignTimeMetadata()); TupleSource ts = procEnv.getDataManager().registerRequest(procEnv.getContext(), insert, TempMetadataAdapter.TEMP_MODEL.getName(), new RegisterRequestParameter());
TeiidComponentException, TeiidProcessingException { VariableContext localContext = procEnv.getCurrentVariableContext(); insert.addVariable(col); insert.addValue(new Constant(procEnv.getCurrentVariableContext().getValue(ProcedurePlan.ROWCOUNT))); QueryResolver.resolveCommand(insert, metadata.getDesignTimeMetadata()); TupleSource ts = procEnv.getDataManager().registerRequest(procEnv.getContext(), insert, TempMetadataAdapter.TEMP_MODEL.getName(), new RegisterRequestParameter());