Package com.odiago.flumebase.parser

Examples of com.odiago.flumebase.parser.Expr.accept()


    after(s, s.getSource());

    Expr where = s.getWhereConditions();
    if (null != where) {
      before(s, where);
      where.accept(this);
      after(s, where);
    }

    GroupBy groupBy = s.getGroupBy();
    if (null != groupBy) {
View Full Code Here


    }

    Expr aggregateOver = s.getWindowOver();
    if (null != aggregateOver) {
      before(s, aggregateOver);
      aggregateOver.accept(this);
      after(s, aggregateOver);
    }

    Expr having = s.getHaving();
    if (null != having) {
View Full Code Here

    }

    Expr having = s.getHaving();
    if (null != having) {
      before(s, having);
      having.accept(this);
      after(s, having);
    }

    List<WindowDef> windowDefs = s.getWindowDefs();
    if (null != windowDefs) {
View Full Code Here

    List<Expr> args = e.getArgExpressions();
    if (null != args) {
      for (int i = 0; i < args.size(); i++) {
        Expr ae = args.get(i);
        before(e, ae);
        ae.accept(this);
        after(e, ae);
      }
    }
  }
View Full Code Here

    // Now visit the where clause; no aggregates allowed there.
    mDisallowAggregates++;
    Expr where = s.getWhereConditions();
    if (null != where) {
      where.accept(this);
    }
    mDisallowAggregates--;


    // Visit the rest of the SELECT statement, including its upstream
View Full Code Here

  public void testBasicBinop() throws VisitException {
    Expr binopExpr = new BinExpr(
      new ConstExpr(Type.getPrimitive(Type.TypeName.INT), Integer.valueOf(2)),
      BinOp.Add, new ConstExpr(Type.getPrimitive(Type.TypeName.INT), Integer.valueOf(3)));
    TypeChecker tc = new TypeChecker(new HashSymbolTable());
    binopExpr.accept(tc);
  }

  @Test
  public void testNestedBinop() throws VisitException {
    Expr binopExpr = new BinExpr(
View Full Code Here

        new ConstExpr(Type.getPrimitive(Type.TypeName.INT), Integer.valueOf(3)),
        BinOp.Add,
        new ConstExpr(Type.getPrimitive(Type.TypeName.INT), Integer.valueOf(4))));

    TypeChecker tc = new TypeChecker(new HashSymbolTable());
    binopExpr.accept(tc);
  }

  @Test(expectedExceptions = VisitException.class)
  public void testBasicBinopFail() throws VisitException {
    // can't add INT and TIMESTAMP.
View Full Code Here

    // can't add INT and TIMESTAMP.
    Expr binopExpr = new BinExpr(
      new ConstExpr(Type.getPrimitive(Type.TypeName.INT), Integer.valueOf(2)),
      BinOp.Add, new ConstExpr(Type.getPrimitive(Type.TypeName.TIMESTAMP), Integer.valueOf(3)));
    TypeChecker tc = new TypeChecker(new HashSymbolTable());
    binopExpr.accept(tc);
  }

  @Test(expectedExceptions = VisitException.class)
  public void testNestedBinopFail() throws VisitException {
    // can't add INT and TIMESTAMP in a subexpr.
View Full Code Here

        new ConstExpr(Type.getPrimitive(Type.TypeName.INT), Integer.valueOf(3)),
        BinOp.Add,
        new ConstExpr(Type.getPrimitive(Type.TypeName.TIMESTAMP), Integer.valueOf(4))));

    TypeChecker tc = new TypeChecker(new HashSymbolTable());
    binopExpr.accept(tc);
  }

  @Test
  public void testPromotion1() throws VisitException {
    // Test that INT can promote to BIGINT.
View Full Code Here

    // Test that INT can promote to BIGINT.
    Expr binopExpr = new BinExpr(
      new ConstExpr(Type.getPrimitive(Type.TypeName.INT), Integer.valueOf(2)),
      BinOp.Add, new ConstExpr(Type.getPrimitive(Type.TypeName.BIGINT), Integer.valueOf(3)));
    TypeChecker tc = new TypeChecker(new HashSymbolTable());
    binopExpr.accept(tc);
  }

  @Test
  public void testPromotion2() throws VisitException {
    // Test that INT can promote to BIGINT on the lhs.
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.