Package org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PhysicalPlan


    }
       
    public void testSort() throws VisitorException, IOException {
      String query = "order (load 'a') by $0;";
      LogicalPlan plan = buildPlan(query);
      PhysicalPlan pp = buildPhysicalPlan(plan);

      int MAX_SIZE = 100000;
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pp.explain(baos);
        baos.write((int)'\n');
        String compiledPlan = baos.toString();
        compiledPlan = compiledPlan.replaceAll("Load(.*)","Load()");

        if(generate){
View Full Code Here


    }
       
    public void testDistinct() throws VisitorException, IOException {
      String query = "distinct (load 'a');";
      LogicalPlan plan = buildPlan(query);
      PhysicalPlan pp = buildPhysicalPlan(plan);
     
      int MAX_SIZE = 100000;
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pp.explain(baos);
        baos.write((int)'\n');
        String compiledPlan = baos.toString();
        compiledPlan = compiledPlan.replaceAll("Load(.*)","Load()");
       
        if(generate){
View Full Code Here

   
    public void testCogroup() throws VisitorException, IOException {
        System.out.println("testCogroup");
      String query = "cogroup (load 'a') by ($0 + $1, $0 - $1), (load 'b') by ($0 + $1, $0 - $1);";
      LogicalPlan plan = buildPlan(query);
      PhysicalPlan pp = buildPhysicalPlan(plan);
     
     
      int MAX_SIZE = 100000;
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pp.explain(baos);
        baos.write((int)'\n');
        String compiledPlan = baos.toString();
        compiledPlan = compiledPlan.replaceAll("Load(.*)","Load()");
       
        if(generate){
View Full Code Here

    public void testArithmetic() throws VisitorException, IOException, ExecException {
     
      String query = "foreach (load 'A') generate $0 + $1 + '5', $0 - '5' - $1, 'hello';";
      LogicalPlan lp = buildPlan(query);
     
      PhysicalPlan pp = buildPhysicalPlan(lp);
     
        //Ensure that there is only 1 leaf node
      assertEquals(1, pp.getLeaves().size());
     
     
      int MAX_SIZE = 100000;
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pp.explain(baos);
        baos.write((int)'\n');
        String compiledPlan = baos.toString();
        compiledPlan = compiledPlan.replaceAll("Load(.*)","Load()");

        if(generate){
View Full Code Here

    }
   
    public void testComparison() throws VisitorException, IOException {
      String query = "filter (load 'a' using " + PigStorage.class.getName() + "(':')) by $0 + $1 > ($0 - $1) * ('4' / '2');";
      LogicalPlan lp = buildPlan(query);
      PhysicalPlan pp = buildPhysicalPlan(lp);
     
        //Ensure that there is only 1 leaf node
      assertEquals(1, pp.getLeaves().size());
     
      int MAX_SIZE = 100000;
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pp.explain(baos);
        baos.write((int)'\n');
        String compiledPlan = baos.toString();
        compiledPlan = compiledPlan.replaceAll("Load(.*)","Load()");
       
        if(generate){
View Full Code Here

    @Test
    public void testBinCond() throws VisitorException, IOException {
        String query = "foreach (load 'a') generate ($1 == '3'? $2 + $3 : $2 - $3) ;";
        LogicalPlan lp = buildPlan(query);

        PhysicalPlan pp = buildPhysicalPlan(lp);

       
        int MAX_SIZE = 100000;
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pp.explain(baos);
        baos.write((int)'\n');
        String compiledPlan = baos.toString();
        compiledPlan = compiledPlan.replaceAll("Load(.*)","Load()");

        if(generate){
View Full Code Here

    @Test
    public void testGenerate() throws VisitorException, IOException {
        String query = "foreach (load 'a') generate ($1+$2), ($1-$2), ($1*$2), ($1/$2), ($1%$2), -($1) ;";
        LogicalPlan lp = buildPlan(query);

        PhysicalPlan pp = buildPhysicalPlan(lp);

       
        int MAX_SIZE = 100000;
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pp.explain(baos);
        baos.write((int)'\n');
        String compiledPlan = baos.toString();
        compiledPlan = compiledPlan.replaceAll("Load(.*)","Load()");

        if(generate){
View Full Code Here

    @Test
    public void testUnion() throws VisitorException, IOException {
      String query = "union (load 'a'), (load 'b'), (load 'c');";
      LogicalPlan lp = buildPlan(query);
      PhysicalPlan pp = buildPhysicalPlan(lp);
     
      int MAX_SIZE = 100000;
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pp.explain(baos);
        baos.write((int)'\n');
        String compiledPlan = baos.toString();
        compiledPlan = compiledPlan.replaceAll("Load(.*)","Load()");

        if(generate){
View Full Code Here

    @Test
    public void testSplit() throws VisitorException, IOException {
      String query = "split (load 'a') into x if $0 < '7', y if $0 > '7';";
      LogicalPlan plan = buildPlan(query);
     
      PhysicalPlan pp = buildPhysicalPlan(plan);
     
      int MAX_SIZE = 100000;
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pp.explain(baos);
        baos.write((int)'\n');
        String compiledPlan = baos.toString();
        compiledPlan = compiledPlan.replaceAll("Load(.*)","Load()");

        if(generate){
View Full Code Here

        //PONot is not implemented. The query below translates to POIsNull istead
        //of PONOt(POIsNull)
      String query = "split (load 'a') into x if $0 IS NULL, y if $0 IS NOT NULL;";
      LogicalPlan plan = buildPlan(query);
     
      PhysicalPlan pp = buildPhysicalPlan(plan);
     
      int MAX_SIZE = 100000;
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pp.explain(baos);
        baos.write((int)'\n');
        String compiledPlan = baos.toString();
        compiledPlan = compiledPlan.replaceAll("Load(.*)","Load()");

        if(generate){
View Full Code Here

TOP

Related Classes of org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PhysicalPlan

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.