Package org.apache.pig.impl.logicalLayer

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


        planTester.buildPlan("A = LOAD 'input1' AS (a0, a1, a2);");
        planTester.buildPlan("B = group A by $0;");
        planTester
                .buildPlan("C = foreach B { D = limit A 10; E = order D by $1; F = order E by $2; generate group, F;};");

        LogicalPlan lp = planTester.buildPlan("store C into '/tmp';");
        PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
        MROperPlan mrPlan = Util.buildMRPlan(pp, pc);

        SecondaryKeyOptimizer so = new SecondaryKeyOptimizer(mrPlan);
        so.visit();
View Full Code Here


        LogicalPlanTester planTester = new LogicalPlanTester();
        planTester.buildPlan("A = LOAD 'input1' AS (a0, a1, a2);");
        planTester.buildPlan("B = group A by $0;");
        planTester.buildPlan("C = foreach B { D = order A by $0 desc; generate group, D;};");

        LogicalPlan lp = planTester.buildPlan("store C into '/tmp';");
        PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
        MROperPlan mrPlan = Util.buildMRPlan(pp, pc);

        SecondaryKeyOptimizer so = new SecondaryKeyOptimizer(mrPlan);
        so.visit();
View Full Code Here

        LogicalPlanTester planTester = new LogicalPlanTester();
        planTester.buildPlan("A = LOAD 'input1' AS (a0, a1, a2);");
        planTester.buildPlan("B = group A by ($0, $1);");
        planTester.buildPlan("C = foreach B { D = order A by $0, $1 desc; generate group, D;};");

        LogicalPlan lp = planTester.buildPlan("store C into '/tmp';");
        PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
        MROperPlan mrPlan = Util.buildMRPlan(pp, pc);

        SecondaryKeyOptimizer so = new SecondaryKeyOptimizer(mrPlan);
        so.visit();
View Full Code Here

        LogicalPlanTester planTester = new LogicalPlanTester();
        planTester.buildPlan("A = LOAD 'input1' AS (a0);");
        planTester.buildPlan("B = group A all;");
        planTester.buildPlan("C = foreach B { D = order A by $0 desc; generate DIFF(D, D);};");

        LogicalPlan lp = planTester.buildPlan("store C into '/tmp';");
        PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
        MROperPlan mrPlan = Util.buildMRPlan(pp, pc);

        SecondaryKeyOptimizer so = new SecondaryKeyOptimizer(mrPlan);
        so.visit();
View Full Code Here

        planTester.buildPlan("A = LOAD 'input1' AS (a0, a1, a2);");
        planTester.buildPlan("B = LOAD 'input2' AS (b0, b1, b2);");
        planTester.buildPlan("C = cogroup A by a0, B by b0;");
        planTester.buildPlan("D = foreach C { E = limit A 10; F = E.a1; G = DISTINCT F; generate group, COUNT(G);};");

        LogicalPlan lp = planTester.buildPlan("store D into '/tmp';");
        PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
        MROperPlan mrPlan = Util.buildMRPlan(pp, pc);

        SecondaryKeyOptimizer so = new SecondaryKeyOptimizer(mrPlan);
        so.visit();
View Full Code Here

        LogicalPlanTester planTester = new LogicalPlanTester();
        planTester.buildPlan("A = LOAD 'input1' AS (a0, a1, a2);");
        planTester.buildPlan("B = group A by $0;");
        planTester.buildPlan("C = foreach B { D = distinct A; generate group, D;};");

        LogicalPlan lp = planTester.buildPlan("store C into '/tmp';");
        PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
        MROperPlan mrPlan = Util.buildMRPlan(pp, pc);

        SecondaryKeyOptimizer so = new SecondaryKeyOptimizer(mrPlan);
        so.visit();
View Full Code Here

   
    @Test
    public void testNonDfsLocation() throws Exception {
        LogicalPlanTester lpt = new LogicalPlanTester();
        String nonDfsUrl = "har://hdfs-namenode/user/foo/";
        LogicalPlan lp = lpt.buildPlan("a = load '" + nonDfsUrl + "';");
        LOLoad load = (LOLoad) lp.getRoots().get(0);
        nonDfsUrl = nonDfsUrl.replaceFirst("/$", "");
        Assert.assertEquals(nonDfsUrl, load.getInputFile().getFileName());
    }
View Full Code Here

            Map<String, String> fileNameMap = new HashMap<String, String>();
           
            LogicalPlanBuilder builder = new LogicalPlanBuilder(pc);
           
            String query = "a = load '"+orig+"';";
            LogicalPlan lp = builder.parse("Test-Load",
                                           query,
                                           aliases,
                                           logicalOpTable,
                                           aliasOp,
                                           fileNameMap);
            Assert.assertTrue(lp.size()>0);
            LogicalOperator op = lp.getRoots().get(0);
           
            Assert.assertTrue(op instanceof LOLoad);
            LOLoad load = (LOLoad)op;
   
            String p = load.getInputFile().getFileName();
View Full Code Here

    @Override
    protected void visit(LOFilter filter) throws VisitorException {
        DataBag outputConstraints = outputConstraintsMap.get(filter);
        outputConstraintsMap.remove(filter);

        LogicalPlan filterCond = filter.getComparisonPlan();
        DataBag inputConstraints = outputConstraintsMap.get(filter.getInput());
        if (inputConstraints == null) {
            inputConstraints = BagFactory.getInstance().newDefaultBag();
            outputConstraintsMap.put(filter.getInput(), inputConstraints);
        }
View Full Code Here

    }
   
    @Test
    public void testMRCompilerErr() throws Exception {
      planTester.buildPlan("a = load 'input';");
      LogicalPlan lp = planTester.buildPlan("b = filter a by $0 > 5;");
     
      PhysicalPlan pp = Util.buildPhysicalPlan(lp, pc);
      pp.remove(pp.getRoots().get(0));
      try {
        Util.buildMRPlan(new PhysicalPlan(), pc);
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.