Examples of VariableContext


Examples of org.teiid.query.sql.util.VariableContext

        while(! isBatchFull()) {
            // May throw BlockedException and exit here
            List tuple = this.finalTupleSource.nextTuple();
            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();
                for (ElementSymbol param : outParams) {
                  Object value = vc.getValue(param);
                  checkNotNull(param, value);
            paramTuple.set(i++, value);
          }
                addBatchRow(paramTuple, true);
              }
View Full Code Here

Examples of org.teiid.query.sql.util.VariableContext

    public void setImplicitParams(Map<ElementSymbol, Reference> implicitParams) {
    this.implicitParams = implicitParams;
  }
       
  private void createVariableContext() {
    this.currentVarContext = new VariableContext(true);
        this.currentVarContext.setValue(ROWS_UPDATED, 0);
        this.currentVarContext.setValue(ROWCOUNT, 0);
  }
View Full Code Here

Examples of org.teiid.query.sql.util.VariableContext

    }
   
    public void push(Program program) {
      program.resetProgramCounter();
        this.programs.push(program);
        VariableContext context = new VariableContext(true);
        context.setParentContext(this.currentVarContext);
        this.currentVarContext = context;
       
        Set<String> current = getTempContext();
       
        Set<String> tempTables = getLocalTempTables();
View Full Code Here

Examples of org.teiid.query.sql.util.VariableContext

        int index = outputElements.indexOf(mappingClassSymbol);

        Object value = values.get(index);

        VariableContext varContext = context.getVariableContext();

        // move on to the next row and don't push the program
        if (value == null) {
            if (Boolean.TRUE.equals(getFirst(varContext))) {
                context.getNextRow(getResultSetName());               
View Full Code Here

Examples of org.teiid.query.sql.util.VariableContext

        this.resultInfo = resultInfo;
        this.bufferMgr = bufferMgr;
       
        ProcessorPlan plan = resultInfo.getPlan();
        CommandContext subContext = context.clone();
        subContext.pushVariableContext(new VariableContext());
        this.internalProcessor = new QueryProcessor(plan, subContext, bufferMgr, dataMgr);
    }
View Full Code Here

Examples of org.teiid.query.sql.util.VariableContext

     * @see org.teiid.query.processor.ProcessorPlan#initialize(org.teiid.query.util.CommandContext, org.teiid.query.processor.ProcessorDataManager, org.teiid.common.buffer.BufferManager)
     * @since 4.2
     */
    public void initialize(CommandContext context, ProcessorDataManager dataMgr, BufferManager bufferMgr) {
      context = context.clone();
      context.setVariableContext(new VariableContext()); //start a new root variable context
      this.setContext(context);
        // Initialize all the child plans
        for (int i = 0; i < getPlanCount(); i++) {
            updatePlans[i].initialize(context, dataMgr, bufferMgr);
        }
View Full Code Here

Examples of org.teiid.query.sql.util.VariableContext

  private void openPlan() throws TeiidComponentException,
      TeiidProcessingException {
    if (this.contexts != null && !this.contexts.isEmpty()) {
      CommandContext context = updatePlans[planIndex].getContext();
      context.getVariableContext().clear();
      VariableContext currentValues = this.contexts.get(planIndex);
      context.getVariableContext().putAll(currentValues);
    }
    updatePlans[planIndex].reset();
    updatePlans[planIndex].open();
    planOpened[planIndex] = true;
View Full Code Here

Examples of org.teiid.query.sql.util.VariableContext

    private String helpGetDocument(ProcessorInstruction addNodeInstruction, Properties namespaceDeclarations) throws Exception{
       
        XMLContext context = new XMLContext();
        FakeXMLProcessorEnvironment env = new FakeXMLProcessorEnvironment();

        VariableContext varContext = context.getVariableContext();
       
        varContext.setValue(new ElementSymbol(RESULT_SET_NAME + STRING_COLUMN), "Lamp"); //$NON-NLS-1$
        varContext.setValue(new ElementSymbol(RESULT_SET_NAME + NULL_COLUMN), null);
       
        Program program = new Program();
        program.addInstruction(addNodeInstruction);
       
    env.pushProgram(program);
View Full Code Here

Examples of org.teiid.query.sql.util.VariableContext

            }
          }
      this.subqueries.put(key, state);
    }
    SymbolMap correlatedRefs = container.getCommand().getCorrelatedReferences();
    VariableContext currentContext = null;
    boolean shouldClose = state.done && state.nonDeterministic;
    if (correlatedRefs != null) {
            currentContext = new VariableContext();
            for (Map.Entry<ElementSymbol, Expression> entry : container.getCommand().getCorrelatedReferences().asMap().entrySet()) {
        currentContext.setValue(entry.getKey(), evaluate(entry.getValue(), tuple));
      }
            List<Object> refValues = currentContext.getLocalValues();
            if (!refValues.equals(state.refValues)) {
              state.refValues = refValues;
              shouldClose = true;
            }
    }
View Full Code Here

Examples of org.teiid.query.sql.util.VariableContext

   
    @Override
    public void open() throws TeiidComponentException,
        TeiidProcessingException {
      CommandContext context  = getContext().clone();
      context.pushVariableContext(new VariableContext());
      this.setContext(context);
      DependentProcedureExecutionNode.shareVariableContext(this, context);
      super.open();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.