Examples of PhysicalPlan


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

                scope, nodeGen.getNextNodeId(scope)));
        physOp.setAlias(cg.getAlias());
        List<PhysicalPlan> exprPlans = new ArrayList<PhysicalPlan>();
        currentPlans.push(currentPlan);
        for (LogicalPlan lp : plans) {
            currentPlan = new PhysicalPlan();
            PlanWalker<LogicalOperator, LogicalPlan> childWalker =
                mCurrentWalker.spawnChildWalker(lp);
            pushWalker(childWalker);
            mCurrentWalker.walk(this);
            exprPlans.add(currentPlan);
View Full Code Here

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

            inp.add(physOp);
            List<LogicalPlan> plans = (List<LogicalPlan>) loj.getJoinPlans().get(op);
            List<PhysicalPlan> exprPlans = new ArrayList<PhysicalPlan>();
            currentPlans.push(currentPlan);
            for (LogicalPlan lp : plans) {
                currentPlan = new PhysicalPlan();
                PlanWalker<LogicalOperator, LogicalPlan> childWalker = mCurrentWalker.spawnChildWalker(lp);
                pushWalker(childWalker);
                mCurrentWalker.walk(this);
                exprPlans.add(currentPlan);
                popWalker();
View Full Code Here

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

        List<PhysicalPlan> fePlans = new ArrayList<PhysicalPlan>();
        List<Boolean> flattenLst = new ArrayList<Boolean>();
        POForEach fe;
        try{
            for(int i=0;i< inputs.size();i++){
                PhysicalPlan fep1 = new PhysicalPlan();
                POProject feproj1 = new POProject(new OperatorKey(scope, nodeGen.getNextNodeId(scope)),
                        parallel, i+1); //i+1 since the first column is the "group" field
                feproj1.setAlias(alias);
                feproj1.setResultType(DataType.BAG);
                feproj1.setOverloaded(false);
                fep1.add(feproj1);
                fePlans.add(fep1);
                // the parser would have marked the side
                // where we need to keep empty bags on
                // non matched as outer (innerFlags[i] would be
                // false)
View Full Code Here

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

        poFilter.setResultType(filter.getType());
        currentPlan.add(poFilter);
        logToPhyMap.put(filter, poFilter);
        currentPlans.push(currentPlan);

        currentPlan = new PhysicalPlan();

        PlanWalker<LogicalOperator, LogicalPlan> childWalker = mCurrentWalker
                .spawnChildWalker(filter.getComparisonPlan());
        pushWalker(childWalker);
        mCurrentWalker.walk(this);
View Full Code Here

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

        List<PhysicalPlan> innerPlans = new ArrayList<PhysicalPlan>();
        List<LogicalPlan> plans = g.getForEachPlans();

        currentPlans.push(currentPlan);
        for (LogicalPlan plan : plans) {
            currentPlan = new PhysicalPlan();
            PlanWalker<LogicalOperator, LogicalPlan> childWalker = new DependencyOrderWalkerWOSeenChk<LogicalOperator, LogicalPlan>(
                    plan);
            pushWalker(childWalker);
            childWalker.walk(this);
            innerPlans.add(currentPlan);
View Full Code Here

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

        List<PhysicalPlan> sortPlans = new ArrayList<PhysicalPlan>(logPlans.size());

        // convert all the logical expression plans to physical expression plans
        currentPlans.push(currentPlan);
        for (LogicalPlan plan : logPlans) {
            currentPlan = new PhysicalPlan();
            PlanWalker<LogicalOperator, LogicalPlan> childWalker = mCurrentWalker
                    .spawnChildWalker(plan);
            pushWalker(childWalker);
            childWalker.walk(this);
            sortPlans.add(currentPlan);
View Full Code Here

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

        physOp.setAlias(split.getAlias());
        logToPhyMap.put(split, physOp);

        currentPlan.add(physOp);
        currentPlans.push(currentPlan);
        currentPlan = new PhysicalPlan();
        PlanWalker<LogicalOperator, LogicalPlan> childWalker = mCurrentWalker
                .spawnChildWalker(split.getConditionPlan());
        pushWalker(childWalker);
        mCurrentWalker.walk(this);
        popWalker();
View Full Code Here

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

            LogicalPlan lp = lpt.buildPlan("C = cogroup A by id, B by id, D by id using 'merge';");
            assertEquals(LOCogroup.GROUPTYPE.MERGE, ((LOCogroup)lp.getLeaves().get(0)).getGroupType());

            PigContext pc = new PigContext(ExecType.MAPREDUCE,cluster.getProperties());
            pc.connect();
            PhysicalPlan phyP = Util.buildPhysicalPlan(lp, pc);
            PhysicalOperator phyOp = phyP.getLeaves().get(0);
            assertTrue(phyOp instanceof POMergeCogroup);

            lp = lpt.buildPlan("store C into 'out';");
            MROperPlan mrPlan = Util.buildMRPlan(Util.buildPhysicalPlan(lp, pc),pc);           
            assertEquals(2,mrPlan.size());
View Full Code Here

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

       
        POForEach fe2 = GenPhyOp.topForEachOPWithPlan(flds , sample);
       
        sp = GenPhyOp.topUnionOp();
       
        PhysicalPlan plan = new PhysicalPlan();
       
        plan.add(ld1);
        plan.add(ld2);
        plan.add(fl1);
        plan.add(fl2);
        plan.add(fe1);
        plan.add(fe2);
        plan.add(sp);
       
        plan.connect(ld1, fe1);
        plan.connect(fe1, fl1);
        plan.connect(ld2, fe2);
        plan.connect(fe2, fl2);
        plan.connect(fl1, sp);
        plan.connect(fl2, sp);
       
        /*PlanPrinter ppp = new PlanPrinter(plan);
        ppp.visit();*/
       
       
View Full Code Here

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

  @Test
  public void testMapLookUp() throws PlanException, ExecException {
   
    POProject prj = new POProject(new OperatorKey("", r.nextLong()), -1, 0);
    POMapLookUp op = new POMapLookUp(new OperatorKey("", r.nextLong()), -1);
    PhysicalPlan plan = new PhysicalPlan();
    plan.add(op);
    plan.add(prj);
    plan.connect(prj, op);
   
    for(int i = 0 ; i < 10; i++) {
      map = GenRandomData.genRandMap(r, 10);
      Tuple t = TupleFactory.getInstance().newTuple();
      t.append(map);
      for(Map.Entry<String, Object> e : map.entrySet()) {
        op.setLookUpKey(e.getKey());
        plan.attachInput(t);
        Result res = op.getNext(map);
        //System.out.println(e.getValue() + " : " + res.result);
        assertEquals(e.getValue(), res.result);
      }
     
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.