Package org.apache.pig.impl.logicalLayer

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


        }
       
        private void postProcess() throws IOException {
           
            // Set the logical plan values correctly in all the operators
            PlanSetter ps = new PlanSetter(lp);
            ps.visit();

            // The following code deals with store/load combination of
            // intermediate files. In this case we will replace the load operator
            // with a (implicit) split operator, iff the load/store
            // func is reversible (because that's when we can safely
View Full Code Here


        physPlan = visitor.getPhysicalPlan();
        LogToPhyMap = visitor.getLogToPhyMap();
    }

    private LogicalPlan refineLogicalPlan(LogicalPlan plan) {
        PlanSetter ps = new PlanSetter(plan);
        try {
            ps.visit();

        } catch (VisitorException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
View Full Code Here

        lpTester.buildPlan("c = join a1 by bcookie, b1 by bcookie;");
        org.apache.pig.impl.logicalLayer.LogicalPlan lp = lpTester
                .buildPlan("d = foreach c generate $4 as bcookie:chararray, " +
                    "$5 as dstid:int, $0 as mrkt:chararray;");
       
        new PlanSetter(lp).visit();
       
        LogicalPlan newLogicalPlan = migrateAndOptimizePlan( lp );
       
        String partFilter = TestLoader.partFilter.toString();
        Assert.assertTrue( "(srcid == 20)".equals( partFilter ) ||  "(srcid == 10)".equals( partFilter ) );
View Full Code Here

        planTester.buildPlan("d = foreach c generate group, FLATTEN(a.marks) as newmarks;");
        planTester.buildPlan("e = cogroup a by marks, d by newmarks;");
        LogicalPlan plan = planTester.buildPlan("f = foreach e generate group, flatten(a), flatten(d);");
       
        // Set the logical plan values correctly in all the operators
        PlanSetter ps = new PlanSetter(plan);
        ps.visit();
       
        // run through validator
        CompilationMessageCollector collector = new CompilationMessageCollector() ;
        TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;
        typeValidator.validate(plan, collector) ;       
View Full Code Here

        }
      
        private void postProcess() throws IOException {
           
            // Set the logical plan values correctly in all the operators
            PlanSetter ps = new PlanSetter(lp);
            ps.visit();
           
            // The following code deals with store/load combination of
            // intermediate files. In this case we will replace the load operator
            // with a (implicit) split operator, iff the load/store
            // func is reversible (because that's when we can safely
View Full Code Here

   
    @SuppressWarnings("unchecked")
    private LogicalPlan compileLp(LogicalPlan lp, boolean optimize) throws
    FrontendException {
        // Set the logical plan values correctly in all the operators
        PlanSetter ps = new PlanSetter(lp);
        ps.visit();
       
        UnionOnSchemaSetter setUnionOnSchema = new UnionOnSchemaSetter(lp, pigContext);
        setUnionOnSchema.visit();
       
        // run through validator
View Full Code Here

        physPlan = visitor.getPhysicalPlan();
        LogToPhyMap = visitor.getLogToPhyMap();
    }

    private LogicalPlan refineLogicalPlan(LogicalPlan plan) {
        PlanSetter ps = new PlanSetter(plan);
        try {
            ps.visit();

        } catch (VisitorException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
View Full Code Here

        }
        return null;
    }

    private LogicalPlan refineLogicalPlan(LogicalPlan plan) {
        PlanSetter ps = new PlanSetter(plan);
        try {
            ps.visit();

        } catch (VisitorException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
View Full Code Here

                    + DummyMetadataLoader.class.getName() + "('"+ checkFileName +"');");
            planTester.buildPlan("B = foreach A generate $0 ;");
            LogicalPlan plan = planTester.buildPlan("C = limit B 10;");
            new LOPrinter(System.err, plan).visit();
            // Set the logical plan values correctly in all the operators
            PlanSetter ps = new PlanSetter(plan);
            ps.visit();
            // the optimizer should run atleast one iteration
            LogicalOptimizerDerivative optimizer =
                new LogicalOptimizerDerivative(plan);
            int numIterations = optimizer.optimize();
            assertTrue(numIterations > 0);
View Full Code Here

        lpTester.buildPlan("c = join a1 by bcookie, b1 by bcookie;");
        LogicalPlan lp = lpTester
                .buildPlan("d = foreach c generate $4 as bcookie:chararray, " +
                    "$5 as dstid:int, $0 as mrkt:chararray;");
       
        new PlanSetter(lp).visit();
       
        lpTester.typeCheckPlan(lp);
        lpTester.optimizePlan(lp);
        assertEquals("checking partition filter:",            
View Full Code Here

TOP

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

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.