Package org.apache.pig.impl.plan

Examples of org.apache.pig.impl.plan.CompilationMessageCollector


        planTester.buildPlan("d = foreach c generate * ;") ;
        planTester.buildPlan("f = foreach d generate group, flatten(a), flatten(b)  ;") ;
        LogicalPlan plan = planTester.buildPlan("g = foreach f generate group, $1 + 1, $2 + 2.0  ;") ;

        // validate
        CompilationMessageCollector collector = new CompilationMessageCollector() ;
        TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;
        try {
            typeValidator.validate(plan, collector) ;
        }
        catch (PlanValidationException pve) {
            //not good
        }

        printMessageCollector(collector) ;
        printTypeGraph(plan) ;
        planTester.printPlan(plan, TypeCheckingTestUtil.getCurrentMethodName());

        if (collector.hasError()) {
            throw new AssertionError("Expect no error") ;
        }

        LOForEach foreach = (LOForEach)plan.getLeaves().get(0);
        LogicalPlan foreachPlan = foreach.getForEachPlans().get(1);
View Full Code Here


        planTester.buildPlan("d = foreach c generate * ;") ;
        planTester.buildPlan("f = foreach d generate group, flatten(a), flatten(b)  ;") ;
        LogicalPlan plan = planTester.buildPlan("g = foreach f generate group, field1 + 1, $4 + 2.0  ;") ;

        // validate
        CompilationMessageCollector collector = new CompilationMessageCollector() ;
        TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;
        try {
            typeValidator.validate(plan, collector) ;
        }
        catch (PlanValidationException pve) {
            //not good
        }

        printMessageCollector(collector) ;
        printTypeGraph(plan) ;
        planTester.printPlan(plan, TypeCheckingTestUtil.getCurrentMethodName());

        if (collector.hasError()) {
            throw new AssertionError("Expect no error") ;
        }

        LOForEach foreach = (LOForEach)plan.getLeaves().get(0);
        LogicalPlan foreachPlan = foreach.getForEachPlans().get(1);
View Full Code Here

        planTester.buildPlan("c = cogroup a by field1, b by field4 ;") ;
        planTester.buildPlan("d = foreach c generate group, flatten(a), flatten(b)  ;") ;
        LogicalPlan plan = planTester.buildPlan("e = foreach d generate group + 1, field1 + 1, field4 + 2.0  ;") ;

        // validate
        CompilationMessageCollector collector = new CompilationMessageCollector() ;
        TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;

        try {
            typeValidator.validate(plan, collector) ;
            fail("Exception expected") ;
        }
        catch (PlanValidationException pve) {
            // good
        }

        printMessageCollector(collector) ;
        printTypeGraph(plan) ;
        planTester.printPlan(plan, TypeCheckingTestUtil.getCurrentMethodName());

        if (!collector.hasError()) {
            throw new AssertionError("Expect error") ;
        }

    }
View Full Code Here

        planTester.buildPlan("c = cogroup a by $0, b by $0 ;") ;
        planTester.buildPlan("d = foreach c generate group, flatten(a), flatten(b)  ;") ;
        LogicalPlan plan = planTester.buildPlan("e = foreach d generate group, $1 + 1, $2 + 2.0  ;") ;

        // validate
        CompilationMessageCollector collector = new CompilationMessageCollector() ;
        TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;
        typeValidator.validate(plan, collector) ;

        printMessageCollector(collector) ;
        printTypeGraph(plan) ;
        planTester.printPlan(plan, TypeCheckingTestUtil.getCurrentMethodName());

        if (collector.hasError()) {
            throw new AssertionError("Expect no  error") ;
        }

        LOForEach foreach = (LOForEach)plan.getLeaves().get(0);
        LogicalPlan foreachPlan = foreach.getForEachPlans().get(1);
View Full Code Here

        planTester.buildPlan("b = load 'a' using PigStorage() as (field4, field5, field6: chararray );") ;
        planTester.buildPlan("c = union a , b ;") ;
        LogicalPlan plan = planTester.buildPlan("d = foreach c generate field2 + 2.0  ;") ;

        // validate
        CompilationMessageCollector collector = new CompilationMessageCollector() ;
        TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;
        typeValidator.validate(plan, collector) ;

        printMessageCollector(collector) ;
        printTypeGraph(plan) ;
        planTester.printPlan(plan, TypeCheckingTestUtil.getCurrentMethodName());

        if (collector.hasError()) {
            throw new AssertionError("Expect no  error") ;
        }


        LOForEach foreach = (LOForEach)plan.getLeaves().get(0);
View Full Code Here

        planTester.buildPlan("b = load 'a' using PigStorage() as (field4, field5, field6: chararray );") ;
        planTester.buildPlan("c = union a , b ;") ;
        LogicalPlan plan = planTester.buildPlan("d = foreach c generate field1 + 2.0  ;") ;

        // validate
        CompilationMessageCollector collector = new CompilationMessageCollector() ;
        TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;

        try {
            typeValidator.validate(plan, collector) ;
            fail("Exception expected") ;
        }
        catch (PlanValidationException pve) {
            // good
        }

        printMessageCollector(collector) ;
        printTypeGraph(plan) ;
        planTester.printPlan(plan, TypeCheckingTestUtil.getCurrentMethodName());

        if (!collector.hasError()) {
            throw new AssertionError("Expect error") ;
        }

    }
View Full Code Here

        planTester.buildPlan("b = load 'a' using BinStorage() ;") ;
        planTester.buildPlan("c = union a , b ;") ;
        LogicalPlan plan = planTester.buildPlan("d = foreach c generate $1 + 2.0  ;") ;

        // validate
        CompilationMessageCollector collector = new CompilationMessageCollector() ;
        TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;

        try {
            typeValidator.validate(plan, collector) ;
        }
        catch (PlanValidationException pve) {
            // good
        }

        printMessageCollector(collector) ;
        printTypeGraph(plan) ;
        planTester.printPlan(plan, TypeCheckingTestUtil.getCurrentMethodName());

        if (collector.hasError()) {
            throw new AssertionError("Expect no  error") ;
        }

        LOForEach foreach = (LOForEach)plan.getLeaves().get(0);
        LogicalPlan foreachPlan = foreach.getForEachPlans().get(0);
View Full Code Here

        planTester.buildPlan("b = load 'a' using PigStorage() ;") ;
        planTester.buildPlan("c = union a , b ;") ;
        LogicalPlan plan = planTester.buildPlan("d = foreach c generate $1 + 2.0  ;") ;

        // validate
        CompilationMessageCollector collector = new CompilationMessageCollector() ;
        TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;

        try {
            typeValidator.validate(plan, collector) ;
            fail("Exception expected") ;
        }
        catch (PlanValidationException pve) {
            // good
        }

        printMessageCollector(collector) ;
        printTypeGraph(plan) ;
        planTester.printPlan(plan, TypeCheckingTestUtil.getCurrentMethodName());

        if (!collector.hasError()) {
            throw new AssertionError("Expect error") ;
        }

    }
View Full Code Here

        planTester.buildPlan("b = load 'a' using PigStorage() as (field4, field5, field6: chararray, field7 );") ;
        planTester.buildPlan("c = union a , b ;") ;
        LogicalPlan plan = planTester.buildPlan("d = foreach c generate $3 + 2.0  ;") ;

        // validate
        CompilationMessageCollector collector = new CompilationMessageCollector() ;
        TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;
        typeValidator.validate(plan, collector) ;

        printMessageCollector(collector) ;
        printTypeGraph(plan) ;
        planTester.printPlan(plan, TypeCheckingTestUtil.getCurrentMethodName());

        if (collector.hasError()) {
            throw new AssertionError("Expect no  error") ;
        }


        LOForEach foreach = (LOForEach)plan.getLeaves().get(0);
View Full Code Here

        planTester.buildPlan("b = load 'a' using PigStorage() as (field4, field5, field6: chararray, field7 );") ;
        planTester.buildPlan("c = union a , b ;") ;
        LogicalPlan plan = planTester.buildPlan("d = foreach c generate $3 + 2.0  ;") ;

        // validate
        CompilationMessageCollector collector = new CompilationMessageCollector() ;
        TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;

        try {
            typeValidator.validate(plan, collector) ;
            fail("Exception expected") ;
        }
        catch (PlanValidationException pve) {
            // good
        }

        printMessageCollector(collector) ;
        printTypeGraph(plan) ;
        planTester.printPlan(plan, TypeCheckingTestUtil.getCurrentMethodName());

        if (!collector.hasError()) {
            throw new AssertionError("Expect error") ;
        }

    }
View Full Code Here

TOP

Related Classes of org.apache.pig.impl.plan.CompilationMessageCollector

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.