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

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLocalRearrangeForIllustrate


        int count = 0;
        Byte type = null;
        for(LogicalOperator lo : inputs) {
            List<LogicalPlan> plans = (List<LogicalPlan>) cg.getGroupByPlans().get(lo);
           
            POLocalRearrangeForIllustrate physOp = new POLocalRearrangeForIllustrate(new OperatorKey(
                    scope, nodeGen.getNextNodeId(scope)), cg
                    .getRequestedParallelism());
            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();

            }
            currentPlan = currentPlans.pop();
            try {
                physOp.setPlans(exprPlans);
            } catch (PlanException pe) {
                throw new VisitorException(pe);
            }
            try {
                physOp.setIndex(count++);
            } catch (ExecException e1) {
                throw new VisitorException(e1);
            }
            if (plans.size() > 1) {
                type = DataType.TUPLE;
                physOp.setKeyType(type);
            } else {
                type = exprPlans.get(0).getLeaves().get(0).getResultType();
                physOp.setKeyType(type);
            }
            physOp.setResultType(DataType.TUPLE);

            currentPlan.add(physOp);

            try {
                currentPlan.connect(logToPhyMap.get(lo), physOp);
View Full Code Here


        int count = 0;
        Byte type = null;
        for(LogicalOperator lo : inputs) {
            List<LogicalPlan> plans = (List<LogicalPlan>) join.getJoinPlans().get(lo);
           
            POLocalRearrangeForIllustrate physOp = new POLocalRearrangeForIllustrate(new OperatorKey(
                    scope, nodeGen.getNextNodeId(scope)), join
                    .getRequestedParallelism());
            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();

            }
            currentPlan = currentPlans.pop();
            try {
                physOp.setPlans(exprPlans);
            } catch (PlanException pe) {
                throw new VisitorException(pe);
            }
            try {
                physOp.setIndex(count++);
            } catch (ExecException e1) {
                throw new VisitorException(e1);
            }
            if (plans.size() > 1) {
                type = DataType.TUPLE;
                physOp.setKeyType(type);
            } else {
                type = exprPlans.get(0).getLeaves().get(0).getResultType();
                physOp.setKeyType(type);
            }
            physOp.setResultType(DataType.TUPLE);

            currentPlan.add(physOp);

            try {
                currentPlan.connect(logToPhyMap.get(lo), physOp);
View Full Code Here

        prj1.setResultType(DataType.INTEGER);
        PhysicalPlan p1 = new PhysicalPlan();
        p1.add(prj1);
        List<PhysicalPlan> in1 = new LinkedList<PhysicalPlan>();
        in1.add(p1);
        POLocalRearrangeForIllustrate lr1 = new POLocalRearrangeForIllustrate(new OperatorKey("", r
                .nextLong()), -1, inputs1);
        lr1.setPlans(in1);
        lr1.setIndex(0);

        List<PhysicalOperator> inputs2 = new LinkedList<PhysicalOperator>();
        inputs2.add(poread2);

        POProject prj2 = new POProject(new OperatorKey("", r.nextLong()), -1, 0);
        prj2.setResultType(DataType.INTEGER);
        PhysicalPlan p2 = new PhysicalPlan();
        p2.add(prj2);
        List<PhysicalPlan> in2 = new LinkedList<PhysicalPlan>();
        in2.add(p2);
        POLocalRearrangeForIllustrate lr2 = new POLocalRearrangeForIllustrate(new OperatorKey("", r
                .nextLong()), -1, inputs2);
        lr2.setPlans(in2);
        lr2.setIndex(1);

        List<PhysicalOperator> inputs = new LinkedList<PhysicalOperator>();
        inputs.add(lr1);
        inputs.add(lr2);
View Full Code Here

        prj1.setResultType(DataType.INTEGER);
        PhysicalPlan p1 = new PhysicalPlan();
        p1.add(prj1);
        List<PhysicalPlan> in1 = new LinkedList<PhysicalPlan>();
        in1.add(p1);
        POLocalRearrangeForIllustrate lr1 = new POLocalRearrangeForIllustrate(new OperatorKey("", r
                .nextLong()), -1, inputs1);
        lr1.setPlans(in1);
        lr1.setIndex(0);

        List<PhysicalOperator> inputs = new LinkedList<PhysicalOperator>();
        inputs.add(lr1);

        List<Tuple> expected = new LinkedList<Tuple>();
View Full Code Here

        int count = 0;
        Byte type = null;
        for(LogicalOperator lo : inputs) {
            List<LogicalPlan> plans = (List<LogicalPlan>) cg.getGroupByPlans().get(lo);
           
            POLocalRearrangeForIllustrate physOp = new POLocalRearrangeForIllustrate(new OperatorKey(
                    scope, nodeGen.getNextNodeId(scope)), cg
                    .getRequestedParallelism());
            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((PhysicalPlan) currentPlan);
                popWalker();

            }
            currentPlan = currentPlans.pop();
            try {
                physOp.setPlans(exprPlans);
            } catch (PlanException pe) {
                throw new VisitorException(pe);
            }
            try {
                physOp.setIndex(count++);
            } catch (ExecException e1) {
                throw new VisitorException(e1);
            }
            if (plans.size() > 1) {
                type = DataType.TUPLE;
                physOp.setKeyType(type);
            } else {
                type = exprPlans.get(0).getLeaves().get(0).getResultType();
                physOp.setKeyType(type);
            }
            physOp.setResultType(DataType.TUPLE);

            currentPlan.add(physOp);

            try {
                currentPlan.connect(LogToPhyMap.get(lo), physOp);
View Full Code Here

        int count = 0;
        Byte type = null;
        for(LogicalOperator lo : inputs) {
            List<LogicalPlan> plans = (List<LogicalPlan>) join.getJoinPlans().get(lo);
           
            POLocalRearrangeForIllustrate physOp = new POLocalRearrangeForIllustrate(new OperatorKey(
                    scope, nodeGen.getNextNodeId(scope)), join
                    .getRequestedParallelism());
            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();

            }
            currentPlan = currentPlans.pop();
            try {
                physOp.setPlans(exprPlans);
            } catch (PlanException pe) {
                throw new VisitorException(pe);
            }
            try {
                physOp.setIndex(count++);
            } catch (ExecException e1) {
                throw new VisitorException(e1);
            }
            if (plans.size() > 1) {
                type = DataType.TUPLE;
                physOp.setKeyType(type);
            } else {
                type = exprPlans.get(0).getLeaves().get(0).getResultType();
                physOp.setKeyType(type);
            }
            physOp.setResultType(DataType.TUPLE);

            currentPlan.add(physOp);

            try {
                currentPlan.connect(LogToPhyMap.get(lo), physOp);
View Full Code Here

        int count = 0;
        Byte type = null;
        for(LogicalOperator lo : inputs) {
            List<LogicalPlan> plans = (List<LogicalPlan>) cg.getGroupByPlans().get(lo);
           
            POLocalRearrangeForIllustrate physOp = new POLocalRearrangeForIllustrate(new OperatorKey(
                    scope, nodeGen.getNextNodeId(scope)), cg
                    .getRequestedParallelism());
            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();

            }
            currentPlan = currentPlans.pop();
            try {
                physOp.setPlans(exprPlans);
            } catch (PlanException pe) {
                throw new VisitorException(pe);
            }
            try {
                physOp.setIndex(count++);
            } catch (ExecException e1) {
                throw new VisitorException(e1);
            }
            if (plans.size() > 1) {
                type = DataType.TUPLE;
                physOp.setKeyType(type);
            } else {
                type = exprPlans.get(0).getLeaves().get(0).getResultType();
                physOp.setKeyType(type);
            }
            physOp.setResultType(DataType.TUPLE);

            currentPlan.add(physOp);

            try {
                currentPlan.connect(logToPhyMap.get(lo), physOp);
View Full Code Here

        int count = 0;
        Byte type = null;
        for(LogicalOperator lo : inputs) {
            List<LogicalPlan> plans = (List<LogicalPlan>) join.getJoinPlans().get(lo);
           
            POLocalRearrangeForIllustrate physOp = new POLocalRearrangeForIllustrate(new OperatorKey(
                    scope, nodeGen.getNextNodeId(scope)), join
                    .getRequestedParallelism());
            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();

            }
            currentPlan = currentPlans.pop();
            try {
                physOp.setPlans(exprPlans);
            } catch (PlanException pe) {
                throw new VisitorException(pe);
            }
            try {
                physOp.setIndex(count++);
            } catch (ExecException e1) {
                throw new VisitorException(e1);
            }
            if (plans.size() > 1) {
                type = DataType.TUPLE;
                physOp.setKeyType(type);
            } else {
                type = exprPlans.get(0).getLeaves().get(0).getResultType();
                physOp.setKeyType(type);
            }
            physOp.setResultType(DataType.TUPLE);

            currentPlan.add(physOp);

            try {
                currentPlan.connect(logToPhyMap.get(lo), physOp);
View Full Code Here

        int count = 0;
        Byte type = null;
        for(LogicalOperator lo : inputs) {
            List<LogicalPlan> plans = (List<LogicalPlan>) cg.getGroupByPlans().get(lo);
           
            POLocalRearrangeForIllustrate physOp = new POLocalRearrangeForIllustrate(new OperatorKey(
                    scope, nodeGen.getNextNodeId(scope)), cg
                    .getRequestedParallelism());
            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((PhysicalPlan) currentPlan);
                popWalker();

            }
            currentPlan = currentPlans.pop();
            try {
                physOp.setPlans(exprPlans);
            } catch (PlanException pe) {
                throw new VisitorException(pe);
            }
            try {
                physOp.setIndex(count++);
            } catch (ExecException e1) {
                throw new VisitorException(e1);
            }
            if (plans.size() > 1) {
                type = DataType.TUPLE;
                physOp.setKeyType(type);
            } else {
                type = exprPlans.get(0).getLeaves().get(0).getResultType();
                physOp.setKeyType(type);
            }
            physOp.setResultType(DataType.TUPLE);

            currentPlan.add(physOp);

            try {
                currentPlan.connect(LogToPhyMap.get(lo), physOp);
View Full Code Here

        prj1.setResultType(DataType.INTEGER);
        PhysicalPlan p1 = new PhysicalPlan();
        p1.add(prj1);
        List<PhysicalPlan> in1 = new LinkedList<PhysicalPlan>();
        in1.add(p1);
        POLocalRearrangeForIllustrate lr1 = new POLocalRearrangeForIllustrate(new OperatorKey("", r
                .nextLong()), -1, inputs1);
        lr1.setPlans(in1);
        lr1.setIndex(0);

        List<PhysicalOperator> inputs2 = new LinkedList<PhysicalOperator>();
        inputs2.add(poread2);

        POProject prj2 = new POProject(new OperatorKey("", r.nextLong()), -1, 0);
        prj2.setResultType(DataType.INTEGER);
        PhysicalPlan p2 = new PhysicalPlan();
        p2.add(prj2);
        List<PhysicalPlan> in2 = new LinkedList<PhysicalPlan>();
        in2.add(p2);
        POLocalRearrangeForIllustrate lr2 = new POLocalRearrangeForIllustrate(new OperatorKey("", r
                .nextLong()), -1, inputs2);
        lr2.setPlans(in2);
        lr2.setIndex(1);

        List<PhysicalOperator> inputs = new LinkedList<PhysicalOperator>();
        inputs.add(lr1);
        inputs.add(lr2);
View Full Code Here

TOP

Related Classes of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLocalRearrangeForIllustrate

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.