Package org.apache.pig.impl.logicalLayer

Examples of org.apache.pig.impl.logicalLayer.LogicalPlan


    @Test
    public void testNumReducersInLimit() throws Exception {
      planTester.buildPlan("a = load 'input';");
      planTester.buildPlan("b = order a by $0;");
      planTester.buildPlan("c = limit b 10;");
      LogicalPlan lp = planTester.buildPlan("store c into '/tmp';");
     
      PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
      MROperPlan mrPlan = Util.buildMRPlan(pp, pc);
      MapReduceOper mrOper = mrPlan.getRoots().get(0);
      int count = 1;
View Full Code Here


    @Test
    public void testNumReducersInLimitWithParallel() throws Exception {
      planTesterMR.buildPlan("a = load 'input';");
      planTesterMR.buildPlan("b = order a by $0 parallel 2;");
      planTesterMR.buildPlan("c = limit b 10;");
      LogicalPlan lp = planTesterMR.buildPlan("store c into '/tmp';");
     
      PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
      MROperPlan mrPlan = Util.buildMRPlan(pp, pc);
      MapReduceOper mrOper = mrPlan.getRoots().get(0);
      int count = 1;
View Full Code Here

    @Test
    public void testUDFInJoin() throws Exception {
        planTester.buildPlan("a = load 'input1' using BinStorage();");
        planTester.buildPlan("b = load 'input2';");
        planTester.buildPlan("c = join a by $0, b by $0;");
        LogicalPlan lp = planTester.buildPlan("store c into '/tmp';");
       
        PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
        MROperPlan mrPlan = Util.buildMRPlan(pp, pc);
        MapReduceOper mrOper = mrPlan.getRoots().get(0);
       
View Full Code Here

        //generate = true;
        planTester.buildPlan("a = load '/tmp/input1';");
        planTester.buildPlan("b = load '/tmp/input2';");
        planTester.buildPlan("c = join a by $0, b by $0 using \"merge\";");
        LogicalPlan lp = planTester.buildPlan("store c into '/tmp';");
       
        PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
        run(pp, "test/org/apache/pig/test/data/GoldenFiles/MRC18.gld");
    }
View Full Code Here

        //generate = true;
        planTester.buildPlan("a = load '/tmp/input1';");
        planTester.buildPlan("b = load '/tmp/input2' using " +
            TestMergeJoin.DummyIndexableLoader.class.getName() + ";");
        planTester.buildPlan("c = join a by $0, b by $0 using \"merge\";");
        LogicalPlan lp = planTester.buildPlan("store c into '/tmp';");
       
        PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
        MROperPlan mp = Util.buildMRPlan(pp, pc);
        assertEquals("Checking number of MR Jobs for merge join with " +
            "IndexableLoadFunc:", 1, mp.size());
View Full Code Here

                "('\t') as (a0, a1, a2);");
        planTester.buildPlan("b = group a by a0;");
        planTester.buildPlan("c = foreach b generate flatten(a);");
        planTester.buildPlan("d = order c by a0;");
        planTester.buildPlan("e = foreach d generate a1+a2;");
        LogicalPlan lp = planTester.buildPlan("store e into '/tmp';");
        planTester.typeCheckPlan(lp);
       
        PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
        MROperPlan mp = Util.buildMRPlan(pp, pc);
        MapReduceOper op = mp.getLeaves().get(0);
View Full Code Here

    PigContext pc = new PigContext(ExecType.LOCAL, new Properties());
    public void testSimplePlan() throws Exception {
        LogicalPlanTester lpt = new LogicalPlanTester(pc);
        lpt.buildPlan("a = load 'd.txt';");
        lpt.buildPlan("b = filter a by $0==NULL;");       
        LogicalPlan plan = lpt.buildPlan("store b into 'empty';");
       
        // check basics
        org.apache.pig.newplan.logical.relational.LogicalPlan newPlan = migratePlan(plan);
        assertEquals(3, newPlan.size());
        assertEquals(newPlan.getSources().size(), 1);
View Full Code Here

   
    public void testPlanWithCast() throws Exception {
        LogicalPlanTester lpt = new LogicalPlanTester(pc);
        lpt.buildPlan("a = load 'd.txt' as (id, c);");
        lpt.buildPlan("b = filter a by (int)id==10;");       
        LogicalPlan plan = lpt.buildPlan("store b into 'empty';");
       
        // check basics
        org.apache.pig.newplan.logical.relational.LogicalPlan newPlan = migratePlan(plan);
        assertEquals(3, newPlan.size());
        assertEquals(newPlan.getSources().size(), 1);
View Full Code Here

        LogicalPlanTester lpt = new LogicalPlanTester(pc);
        lpt.buildPlan("a = load 'd1.txt' as (id, c);");
        lpt.buildPlan("b = load 'd2.txt'as (id, c);");
        lpt.buildPlan("c = join a by id, b by c;");
        lpt.buildPlan("d = filter c by a::id==NULL AND b::c==NULL;");       
        LogicalPlan plan = lpt.buildPlan("store d into 'empty';");
     
        // check basics
        org.apache.pig.newplan.logical.relational.LogicalPlan newPlan = migratePlan(plan);
        assertEquals(5, newPlan.size());
        assertEquals(newPlan.getSources().size(), 2);
View Full Code Here

   
    public void testForeachPlan() throws Exception {
        LogicalPlanTester lpt = new LogicalPlanTester(pc);
        lpt.buildPlan("a = load '/test/d.txt' as (id, d);");
        lpt.buildPlan("b = foreach a generate id, FLATTEN(d);");       
        LogicalPlan plan = lpt.buildPlan("store b into '/test/empty';");
       
        // check basics
        org.apache.pig.newplan.logical.relational.LogicalPlan newPlan = migratePlan(plan);
       
        org.apache.pig.newplan.logical.relational.LogicalPlan expected =
View Full Code Here

TOP

Related Classes of org.apache.pig.impl.logicalLayer.LogicalPlan

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.