Package org.apache.tajo.algebra

Examples of org.apache.tajo.algebra.Expr


  }

  @Test
  public final void testSetPlan2() throws PlanningException {
    // for testing multiple set statements
    Expr expr = sqlAnalyzer.parse(setStatements[1]);
    LogicalPlan plan = planner.createPlan(expr);
    System.out.println(plan);
    LogicalRootNode root = plan.getRootBlock().getRoot();
    testJsonSerDerObject(root);
    assertEquals(NodeType.ROOT, root.getType());
View Full Code Here


  }

  @Test
  public final void testSetPlan3() throws PlanningException {
    // for testing multiple set statements
    Expr expr = sqlAnalyzer.parse(setStatements[2]);
    LogicalPlan plan = planner.createPlan(expr);
    LogicalRootNode root = plan.getRootBlock().getRoot();
    testJsonSerDerObject(root);
    assertEquals(NodeType.ROOT, root.getType());
    assertEquals(NodeType.EXCEPT, root.getChild().getType());
View Full Code Here

    "select all name, empid from employee",
  };

  @Test
  public void testSetQualifier() throws PlanningException {
    Expr context = sqlAnalyzer.parse(setQualifiers[0]);
    LogicalNode plan = planner.createPlan(context).getRootBlock().getRoot();
    testJsonSerDerObject(plan);
    assertEquals(NodeType.ROOT, plan.getType());
    LogicalRootNode root = (LogicalRootNode) plan;
    assertEquals(NodeType.PROJECTION, root.getChild().getType());
View Full Code Here

      "insert overwrite into LOCATION '/tmp/data' select * from dept"       // 5
  };

  @Test
  public final void testInsertInto0() throws PlanningException {
    Expr expr = sqlAnalyzer.parse(insertStatements[0]);
    LogicalPlan plan = planner.createPlan(expr);
    assertEquals(2, plan.getQueryBlocks().size());
    InsertNode insertNode = getInsertNode(plan);
    assertFalse(insertNode.isOverwrite());
    assertTrue(insertNode.hasTargetTable());
View Full Code Here

    assertEquals("score", insertNode.getTargetTable().getName());
  }

  @Test
  public final void testInsertInto1() throws PlanningException {
    Expr expr = sqlAnalyzer.parse(insertStatements[1]);
    LogicalPlan plan = planner.createPlan(expr);
    assertEquals(2, plan.getQueryBlocks().size());
    InsertNode insertNode = getInsertNode(plan);
    assertFalse(insertNode.isOverwrite());
    assertEquals("score", insertNode.getTargetTable().getName());
View Full Code Here

    assertEquals("score", insertNode.getTargetTable().getName());
  }

  @Test
  public final void testInsertInto2() throws PlanningException {
    Expr expr = sqlAnalyzer.parse(insertStatements[2]);
    LogicalPlan plan = planner.createPlan(expr);
    assertEquals(2, plan.getQueryBlocks().size());
    InsertNode insertNode = getInsertNode(plan);
    assertFalse(insertNode.isOverwrite());
    assertEquals("employee", insertNode.getTargetTable().getName());
View Full Code Here

    EvalNode fromJson = CoreGsonHelper.fromJson(json, EvalNode.class);
    assertEquals(expr, fromJson);
  }

  private static Target[] getRawTargets(String query) throws PlanningException {
    Expr expr = analyzer.parse(query);
    LogicalPlan plan = planner.createPlan(expr);
    Target [] targets = plan.getRootBlock().getTargetListManager().getUnresolvedTargets();
    if (targets == null) {
      throw new PlanningException("Wrong query statement or query plan: " + query);
    }
View Full Code Here

    assertEquals(insertNode.getTargetSchema().getColumn(1).getColumnName(), "deptname");
  }

  @Test
  public final void testInsertInto3() throws PlanningException {
    Expr expr = sqlAnalyzer.parse(insertStatements[3]);
    LogicalPlan plan = planner.createPlan(expr);
    assertEquals(2, plan.getQueryBlocks().size());
    InsertNode insertNode = getInsertNode(plan);
    assertFalse(insertNode.isOverwrite());
    assertTrue(insertNode.hasPath());
View Full Code Here

    assertTrue(insertNode.hasPath());
  }

  @Test
  public final void testInsertInto4() throws PlanningException {
    Expr expr = sqlAnalyzer.parse(insertStatements[4]);
    LogicalPlan plan = planner.createPlan(expr);
    assertEquals(2, plan.getQueryBlocks().size());
    InsertNode insertNode = getInsertNode(plan);
    assertTrue(insertNode.isOverwrite());
    assertTrue(insertNode.hasTargetTable());
View Full Code Here

    assertEquals(insertNode.getTargetSchema().getColumn(1).getColumnName(), "deptname");
  }

  @Test
  public final void testInsertInto5() throws PlanningException {
    Expr expr = sqlAnalyzer.parse(insertStatements[5]);
    LogicalPlan plan = planner.createPlan(expr);
    assertEquals(2, plan.getQueryBlocks().size());
    InsertNode insertNode = getInsertNode(plan);
    assertTrue(insertNode.isOverwrite());
    assertTrue(insertNode.hasPath());
View Full Code Here

TOP

Related Classes of org.apache.tajo.algebra.Expr

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.