@Test public void testSpl2() throws Exception { PhysicalPlan php = new PhysicalPlan(); POLoad lA = GenPhyOp.topLoadOp(); POSplit spl = GenPhyOp.topSplitOp(); php.add(lA); php.add(spl); php.connect(lA, spl); POFilter fl1 = GenPhyOp.topFilterOp(); POFilter fl2 = GenPhyOp.topFilterOp(); php.add(fl1); php.add(fl2); php.connect(spl, fl1); php.connect(spl, fl2); POLocalRearrange lr1 = GenPhyOp.topLocalRearrangeOp(); POLocalRearrange lr2 = GenPhyOp.topLocalRearrangeOp(); php.add(lr1); php.add(lr2); php.connect(fl1, lr1); php.connect(fl2, lr2); POGlobalRearrange gr = GenPhyOp.topGlobalRearrangeOp(); php.addAsLeaf(gr); POPackage pk = GenPhyOp.topPackageOp(); php.addAsLeaf(pk); POSplit sp2 = GenPhyOp.topSplitOp(); php.addAsLeaf(sp2); POFilter fl3 = GenPhyOp.topFilterOp(); POFilter fl4 = GenPhyOp.topFilterOp(); php.add(fl3); php.add(fl4); php.connect(sp2, fl3); php.connect(sp2, fl4); POUnion un = GenPhyOp.topUnionOp(); php.addAsLeaf(un); POStore st = GenPhyOp.topStoreOp(); php.addAsLeaf(st); run(php, "test/org/apache/pig/test/data/GoldenFiles/MRC13.gld"); }
@Test(expected = MRCompilerException.class) public void testMRCompilerErr1() throws Exception { PhysicalPlan pp = new PhysicalPlan(); PhysicalPlan ldFil1 = GenPhyOp.loadedFilter(); pp.merge(ldFil1); POSplit op = GenPhyOp.topSplitOp(); pp.addAsLeaf(op); try { Util.buildMRPlan(pp, pc); } catch (MRCompilerException mrce) { assertEquals(2025, mrce.getErrorCode()); throw mrce; } }
@Test public void testMRCompilerErr1() throws Exception { PhysicalPlan pp = new PhysicalPlan(); PhysicalPlan ldFil1 = GenPhyOp.loadedFilter(); pp.merge(ldFil1); POSplit op = GenPhyOp.topSplitOp(); pp.addAsLeaf(op); try { Util.buildMRPlan(pp, pc); fail("Expected failure."); } catch (MRCompilerException mrce) { assertTrue(mrce.getErrorCode() == 2025); } }
public void testSpl1() throws Exception { PhysicalPlan php = new PhysicalPlan(); POLoad lA = GenPhyOp.topLoadOp(); POSplit spl = GenPhyOp.topSplitOp(); php.add(lA); php.add(spl); php.connect(lA, spl); POFilter fl1 = GenPhyOp.topFilterOp(); POFilter fl2 = GenPhyOp.topFilterOp(); php.add(fl1); php.add(fl2); php.connect(spl, fl1); php.connect(spl, fl2); POLocalRearrange lr1 = GenPhyOp.topLocalRearrangeOp(); POLocalRearrange lr2 = GenPhyOp.topLocalRearrangeOp(); php.add(lr1); php.add(lr2); php.connect(fl1, lr1); php.connect(fl2, lr2); POGlobalRearrange gr = GenPhyOp.topGlobalRearrangeOp(); php.add(gr); php.connect(lr1, gr); php.connect(lr2, gr); POPackage pk = GenPhyOp.topPackageOp(); php.add(pk); php.connect(gr, pk); POStore st = GenPhyOp.topStoreOp(); php.add(st); php.connect(pk, st); run(php, "test/org/apache/pig/test/data/GoldenFiles/MRC12.gld"); }
@Test public void testSpl3() throws Exception { PhysicalPlan php = new PhysicalPlan(); POLoad lA = GenPhyOp.topLoadOp(); POSplit spl = GenPhyOp.topSplitOp(); php.add(lA); php.add(spl); php.connect(lA, spl); POFilter fl1 = GenPhyOp.topFilterOp(); fl1.setRequestedParallelism(10); POFilter fl2 = GenPhyOp.topFilterOp(); fl2.setRequestedParallelism(20); php.add(fl1); php.add(fl2); php.connect(spl, fl1); php.connect(spl, fl2); POSplit sp11 = GenPhyOp.topSplitOp(); POSplit sp21 = GenPhyOp.topSplitOp(); php.add(sp11); php.add(sp21); php.connect(fl1, sp11); php.connect(fl2, sp21); POFilter fl11 = GenPhyOp.topFilterOp(); fl11.setRequestedParallelism(10); POFilter fl21 = GenPhyOp.topFilterOp(); fl21.setRequestedParallelism(20); POFilter fl22 = GenPhyOp.topFilterOp(); fl22.setRequestedParallelism(30); php.add(fl11); php.add(fl21); php.add(fl22); php.connect(sp11, fl11); php.connect(sp21, fl21); php.connect(sp21, fl22); POLocalRearrange lr1 = GenPhyOp.topLocalRearrangeOp(); lr1.setRequestedParallelism(40); POLocalRearrange lr21 = GenPhyOp.topLocalRearrangeOp(); lr21.setRequestedParallelism(15); POLocalRearrange lr22 = GenPhyOp.topLocalRearrangeOp(); lr22.setRequestedParallelism(35); php.add(lr1); php.add(lr21); php.add(lr22); php.connect(fl11, lr1); php.connect(fl21, lr21); php.connect(fl22, lr22); POGlobalRearrange gr = GenPhyOp.topGlobalRearrangeOp(); php.addAsLeaf(gr); POPackage pk = GenPhyOp.topPackageOp(); pk.setRequestedParallelism(25); php.addAsLeaf(pk); POSplit sp2 = GenPhyOp.topSplitOp(); php.addAsLeaf(sp2); POFilter fl3 = GenPhyOp.topFilterOp(); fl3.setRequestedParallelism(100); POFilter fl4 = GenPhyOp.topFilterOp(); fl4.setRequestedParallelism(80); php.add(fl3); php.add(fl4); php.connect(sp2, fl3); php.connect(sp2, fl4); POUnion un = GenPhyOp.topUnionOp(); php.addAsLeaf(un); POStore st = GenPhyOp.topStoreOp(); php.addAsLeaf(st); run(php, "test/org/apache/pig/test/data/GoldenFiles/MRC14.gld"); }