示例#1
0
 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));
   }
 }
示例#2
0
 protected void setParameterValue(ElementSymbol param, VariableContext context, Object value) {
   context.setValue(param, value);
 }