Package com.odiago.flumebase.parser

Examples of com.odiago.flumebase.parser.SQLStatement


    try {
      // Send the parser's error messages into a buffer rather than stderr.
      ByteArrayOutputStream errBufferStream = new ByteArrayOutputStream();
      PrintStream errStream = new PrintStream(errBufferStream);

      SQLStatement stmt = mGenerator.parse(query, errStream);

      errStream.close();
      String errMsg = new String(errBufferStream.toByteArray());
      msgBuilder.append(errMsg);

      if (null == stmt) {
        msgBuilder.append("(Could not parse command)");
        return new QuerySubmitResponse(msgBuilder.toString(), null);
      }

      stmt.accept(new AssignFieldLabelsVisitor());
      stmt.accept(new CountStarVisitor()); // Must be after assign labels, before TC.
      stmt.accept(new TypeChecker(mRootSymbolTable));
      stmt.accept(new ReplaceWindows()); // Must be after TC.
      stmt.accept(new JoinKeyVisitor()); // Must be after TC.
      stmt.accept(new JoinNameVisitor());
      stmt.accept(new IdentifyAggregates()); // Must be after TC.
      PlanContext planContext = new PlanContext();
      planContext.setConf(planConf);
      planContext.setSymbolTable(mRootSymbolTable);
      PlanContext retContext = stmt.createExecPlan(planContext);
      msgBuilder.append(retContext.getMsgBuilder().toString());
      FlowSpecification spec = retContext.getFlowSpec();
      if (null != spec) {
        spec.setQuery(query);
        spec.setConf(planConf);
View Full Code Here


    mNewChild = newChild;
  }

  @Override
  protected void visit(CreateStreamStmt s) throws VisitException {
    SQLStatement child = s.getFormatSpec();
    if (mOldChild == child) {
      s.setFormatSpec((FormatSpec) mNewChild);
    }

    super.visit(s);
View Full Code Here

      if (mOldChild == exprs.get(i)) {
        exprs.set(i, (AliasedExpr) mNewChild);
      }
    }

    SQLStatement src = s.getSource();
    if (mOldChild == src) {
      s.setSource(mNewChild);
    }

    Expr where = s.getWhereConditions();
View Full Code Here

    super.visit(s);
  }

  @Override
  protected void visit(ExplainStmt s) throws VisitException {
    SQLStatement child = s.getChildStmt();
    if (mOldChild == child) {
      s.setChildStmt(mNewChild);
    }

    super.visit(s);
View Full Code Here

        symbolsForSources.addSymbol(new WindowSymbol(def.getName(), def.getWindowSpec()));
      }
      mSymTableContext.push(symbolsForSources);
     
      // Now visit the sources, with the symbols for any windows pushed.
      SQLStatement source = s.getSource();
      visitValidSource(source);

      SymbolTable exprTable = mSymTableContext.top();
      outTable = new HashSymbolTable(originalSymtab);
View Full Code Here

    }
  }

  @Override
  protected void visit(JoinedSource s) throws VisitException {
    SQLStatement leftSrc = s.getLeft();
    SQLStatement rightSrc = s.getRight();
    LOG.debug("Visiting joinedsrc");

    int symtabHeight = mSymTableContext.size();

    visitValidSource(leftSrc);
View Full Code Here

TOP

Related Classes of com.odiago.flumebase.parser.SQLStatement

Copyright © 2018 www.massapicom. 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.