Package org.apache.pig.test.utils

Examples of org.apache.pig.test.utils.LogicalPlanTester.buildPlan()


    public void test1() throws FrontendException {
        LogicalPlanTester lpt = new LogicalPlanTester( pc );
        lpt.buildPlan( "A = LOAD 'file.txt' AS (a(u,v), b, c);" );
        lpt.buildPlan( "B = FOREACH A GENERATE $0, b;" );
        lpt.buildPlan( "C = FILTER B BY " + Identity.class.getName() +"($0, $1) > 5;" );
        org.apache.pig.impl.logicalLayer.LogicalPlan plan = lpt.buildPlan( "STORE C INTO 'empty';" )
        LogicalPlan newLogicalPlan = migrateAndOptimizePlan( plan );

        Operator load = newLogicalPlan.getSources().get( 0 );
        Assert.assertTrue( load instanceof LOLoad );
        Operator fe1 = newLogicalPlan.getSuccessors( load ).get( 0 );
View Full Code Here


     * Identical to test1() except that it use project *.
     */
    @Test
    public void test2() throws FrontendException {
        LogicalPlanTester lpt = new LogicalPlanTester( pc );
        lpt.buildPlan( "A = LOAD 'file.txt' AS (a(u,v), b, c);" );
        lpt.buildPlan( "B = FOREACH A GENERATE $0, b;" );
        lpt.buildPlan( "C = FILTER B BY " + Identity.class.getName() +"(*) > 5;" );
        org.apache.pig.impl.logicalLayer.LogicalPlan plan = lpt.buildPlan( "STORE C INTO 'empty';" )
        LogicalPlan newLogicalPlan = migrateAndOptimizePlan( plan );

View Full Code Here

     */
    @Test
    public void test2() throws FrontendException {
        LogicalPlanTester lpt = new LogicalPlanTester( pc );
        lpt.buildPlan( "A = LOAD 'file.txt' AS (a(u,v), b, c);" );
        lpt.buildPlan( "B = FOREACH A GENERATE $0, b;" );
        lpt.buildPlan( "C = FILTER B BY " + Identity.class.getName() +"(*) > 5;" );
        org.apache.pig.impl.logicalLayer.LogicalPlan plan = lpt.buildPlan( "STORE C INTO 'empty';" )
        LogicalPlan newLogicalPlan = migrateAndOptimizePlan( plan );

        Operator load = newLogicalPlan.getSources().get( 0 );
View Full Code Here

    @Test
    public void test2() throws FrontendException {
        LogicalPlanTester lpt = new LogicalPlanTester( pc );
        lpt.buildPlan( "A = LOAD 'file.txt' AS (a(u,v), b, c);" );
        lpt.buildPlan( "B = FOREACH A GENERATE $0, b;" );
        lpt.buildPlan( "C = FILTER B BY " + Identity.class.getName() +"(*) > 5;" );
        org.apache.pig.impl.logicalLayer.LogicalPlan plan = lpt.buildPlan( "STORE C INTO 'empty';" )
        LogicalPlan newLogicalPlan = migrateAndOptimizePlan( plan );

        Operator load = newLogicalPlan.getSources().get( 0 );
        Assert.assertTrue( load instanceof LOLoad );
View Full Code Here

    public void test2() throws FrontendException {
        LogicalPlanTester lpt = new LogicalPlanTester( pc );
        lpt.buildPlan( "A = LOAD 'file.txt' AS (a(u,v), b, c);" );
        lpt.buildPlan( "B = FOREACH A GENERATE $0, b;" );
        lpt.buildPlan( "C = FILTER B BY " + Identity.class.getName() +"(*) > 5;" );
        org.apache.pig.impl.logicalLayer.LogicalPlan plan = lpt.buildPlan( "STORE C INTO 'empty';" )
        LogicalPlan newLogicalPlan = migrateAndOptimizePlan( plan );

        Operator load = newLogicalPlan.getSources().get( 0 );
        Assert.assertTrue( load instanceof LOLoad );
        Operator fe1 = newLogicalPlan.getSuccessors( load ).get( 0 );
View Full Code Here

     * No fields are used in filter condition at all.
     */
    @Test
    public void test3() throws FrontendException {
        LogicalPlanTester lpt = new LogicalPlanTester( pc );
        lpt.buildPlan( "A = LOAD 'file.txt' AS (a(u,v), b, c);" );
        lpt.buildPlan( "B = FOREACH A GENERATE $0, b;" );
        lpt.buildPlan( "C = FILTER B BY 8 > 5;" );
        org.apache.pig.impl.logicalLayer.LogicalPlan plan = lpt.buildPlan( "STORE C INTO 'empty';" )
        LogicalPlan newLogicalPlan = migrateAndOptimizePlan( plan );

View Full Code Here

     */
    @Test
    public void test3() throws FrontendException {
        LogicalPlanTester lpt = new LogicalPlanTester( pc );
        lpt.buildPlan( "A = LOAD 'file.txt' AS (a(u,v), b, c);" );
        lpt.buildPlan( "B = FOREACH A GENERATE $0, b;" );
        lpt.buildPlan( "C = FILTER B BY 8 > 5;" );
        org.apache.pig.impl.logicalLayer.LogicalPlan plan = lpt.buildPlan( "STORE C INTO 'empty';" )
        LogicalPlan newLogicalPlan = migrateAndOptimizePlan( plan );

        Operator load = newLogicalPlan.getSources().get( 0 );
View Full Code Here

    @Test
    public void test3() throws FrontendException {
        LogicalPlanTester lpt = new LogicalPlanTester( pc );
        lpt.buildPlan( "A = LOAD 'file.txt' AS (a(u,v), b, c);" );
        lpt.buildPlan( "B = FOREACH A GENERATE $0, b;" );
        lpt.buildPlan( "C = FILTER B BY 8 > 5;" );
        org.apache.pig.impl.logicalLayer.LogicalPlan plan = lpt.buildPlan( "STORE C INTO 'empty';" )
        LogicalPlan newLogicalPlan = migrateAndOptimizePlan( plan );

        Operator load = newLogicalPlan.getSources().get( 0 );
        Assert.assertTrue( load instanceof LOLoad );
View Full Code Here

    public void test3() throws FrontendException {
        LogicalPlanTester lpt = new LogicalPlanTester( pc );
        lpt.buildPlan( "A = LOAD 'file.txt' AS (a(u,v), b, c);" );
        lpt.buildPlan( "B = FOREACH A GENERATE $0, b;" );
        lpt.buildPlan( "C = FILTER B BY 8 > 5;" );
        org.apache.pig.impl.logicalLayer.LogicalPlan plan = lpt.buildPlan( "STORE C INTO 'empty';" )
        LogicalPlan newLogicalPlan = migrateAndOptimizePlan( plan );

        Operator load = newLogicalPlan.getSources().get( 0 );
        Assert.assertTrue( load instanceof LOLoad );
        Operator filter = newLogicalPlan.getSuccessors( load ).get( 0 );
View Full Code Here

     * Optimziation doesn't kick in.
     */
    @Test
    public void test4() throws FrontendException {
        LogicalPlanTester lpt = new LogicalPlanTester( pc );
        lpt.buildPlan( "A = LOAD 'file.txt' AS (a(u,v), b, c);" );
        lpt.buildPlan( "B = FOREACH A GENERATE $0, b, flatten(1);" );
        lpt.buildPlan( "C = FILTER B BY " + Identity.class.getName() +"(*) > 5;" );
        org.apache.pig.impl.logicalLayer.LogicalPlan plan = lpt.buildPlan( "STORE C INTO 'empty';" )
        LogicalPlan newLogicalPlan = migrateAndOptimizePlan( plan );

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.