Package org.apache.pig.impl.plan

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


        plan.connect(constant2, subtract1) ;

        // Before type checking its set correctly = PIG-421
        assertEquals(DataType.LONG, subtract1.getType()) ;

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

        printTypeGraph(plan) ;
View Full Code Here


        plan.connect(constant2, mod1) ;

        // Before type checking its set correctly = PIG-421
        assertEquals(DataType.LONG, mod1.getType()) ;

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

        printTypeGraph(plan) ;
View Full Code Here

        plan.add(regex) ;

        plan.connect(constant1, regex) ;    
        plan.connect(constant2, regex) ;    

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

        printTypeGraph(plan) ;
View Full Code Here

        plan.add(regex) ;

        plan.connect(constant1, regex) ;
        plan.connect(constant2, regex) ;

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

        printTypeGraph(plan) ;

        // After type checking

        if (collector.hasError()) {
            throw new Exception("Error not expected during type checking") ;
        }      
       
        // check type
        System.out.println(DataType.findTypeName(regex.getType())) ;
View Full Code Here

        plan.connect(constant1, regex) ;
        plan.connect(constant2, regex) ;

        try {
            CompilationMessageCollector collector = new CompilationMessageCollector() ;
            TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;
            typeValidator.validate(plan, collector) ;
            printMessageCollector(collector) ;
            fail("Exception expected") ;
        }
View Full Code Here

        plan.connect(load1, union);
        plan.connect(load2, union);

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

        // check end result schema
View Full Code Here

        plan.connect(load1, union);
        plan.connect(load2, union);

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

        // check end result schema
View Full Code Here

        plan.add(distinct1) ;

        plan.connect(load1, distinct1);

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

        // check end result schema
View Full Code Here

        plan.add(load1);
        plan.add(filter1);
        plan.connect(load1, filter1) ;

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

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

        Schema endResultSchema = filter1.getSchema() ;
        assertEquals(endResultSchema.getField(0).type, field1Type) ;
View Full Code Here

        plan.add(load1);
        plan.add(filter1);
        plan.connect(load1, filter1) ;

        CompilationMessageCollector collector = new CompilationMessageCollector() ;
        TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;
        try {
            typeValidator.validate(plan, collector) ;
            fail("Error expected") ;
        }
        catch (Exception t) {
            // good
        }
        printMessageCollector(collector) ;
        printTypeGraph(plan) ;

        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.