Package org.apache.pig.impl.plan

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


        planTester.buildPlan("a = load 'a' as (url, hitCount);");
        LogicalPlan lp = planTester.buildPlan("split a into b if url == '3', c if hitCount == '3';");
       
        //check that the load projection map is null
        LOLoad load = (LOLoad) lp.getRoots().get(0);
        ProjectionMap loadProjectionMap = load.getProjectionMap();
        assertTrue(loadProjectionMap.changes() == false);
       
        //check that the split projection map has null mappedFields
        LOSplit split = (LOSplit)lp.getSuccessors(load).get(0);
        ProjectionMap splitProjectionMap = split.getProjectionMap();
        assertTrue(splitProjectionMap.changes() == false);
       
        LOSplitOutput splitb = (LOSplitOutput)lp.getSuccessors(split).get(0);
        ProjectionMap splitbProjectionMap = splitb.getProjectionMap();
        assertTrue(splitbProjectionMap.changes() == false);
       
        LOSplitOutput splitc = (LOSplitOutput)lp.getSuccessors(split).get(1);
        ProjectionMap splitcProjectionMap = splitc.getProjectionMap();
        assertTrue(splitcProjectionMap.changes() == false);
    }
View Full Code Here


        planTester.buildPlan("a = load 'a' as (url,hitCount);");
        LogicalPlan lp = planTester.buildPlan("b = order a by $1;");
       
        //check that the load projection map is null
        LOLoad load = (LOLoad) lp.getRoots().get(0);
        ProjectionMap loadProjectionMap = load.getProjectionMap();
        assertTrue(loadProjectionMap.changes() == false);
       
        //check that the order by projection map is not null
        LOSort sort = (LOSort)lp.getLeaves().get(0);
        ProjectionMap sortProjectionMap = sort.getProjectionMap();
        assertTrue(sortProjectionMap != null);
        assertTrue(sortProjectionMap.changes() == false);
    }
View Full Code Here

        planTester.buildPlan("b = order a by $1;");
        LogicalPlan lp = planTester.buildPlan("c = limit b 10;");
       
        //check that the load projection map is null
        LOLoad load = (LOLoad) lp.getRoots().get(0);
        ProjectionMap loadProjectionMap = load.getProjectionMap();
        assertTrue(loadProjectionMap.changes() == false);
       
        //check that the order by projection map is not null
        LOSort sort = (LOSort)lp.getSuccessors(load).get(0);
        ProjectionMap sortProjectionMap = sort.getProjectionMap();
        assertTrue(sortProjectionMap != null);
        assertTrue(sortProjectionMap.changes() == false);
       
        //check that the limit projection map is not null
        LOLimit limit = (LOLimit)lp.getLeaves().get(0);
        ProjectionMap limitProjectionMap = limit.getProjectionMap();
        assertTrue(limitProjectionMap != null);
        assertTrue(limitProjectionMap.changes() == false);
    }
View Full Code Here

        planTester.buildPlan("a = load 'a';");
        LogicalPlan lp = planTester.buildPlan("b = filter a by $1 == '3';");
       
        //check that the load projection map is null
        LOLoad load = (LOLoad) lp.getRoots().get(0);
        ProjectionMap loadProjectionMap = load.getProjectionMap();
        assertTrue(loadProjectionMap.changes() == false);
       
        //check that the filter projection map has null mappedFields
        LOFilter filter = (LOFilter)lp.getLeaves().get(0);
        ProjectionMap filterProjectionMap = filter.getProjectionMap();
        assertTrue(filterProjectionMap.changes() == false);
    }
View Full Code Here

        planTester.buildPlan("a = load 'a';");
        LogicalPlan lp = planTester.buildPlan("split a into b if $0 == '3', c if $1 == '3';");
       
        //check that the load projection map is null
        LOLoad load = (LOLoad) lp.getRoots().get(0);
        ProjectionMap loadProjectionMap = load.getProjectionMap();
        assertTrue(loadProjectionMap.changes() == false);
       
        //check that the split projection map has null mappedFields
        LOSplit split = (LOSplit)lp.getSuccessors(load).get(0);
        ProjectionMap splitProjectionMap = split.getProjectionMap();
        assertTrue(splitProjectionMap.changes() == false);
       
        LOSplitOutput splitb = (LOSplitOutput)lp.getSuccessors(split).get(0);
        ProjectionMap splitbProjectionMap = splitb.getProjectionMap();
        assertTrue(splitbProjectionMap.changes() == false);
       
        LOSplitOutput splitc = (LOSplitOutput)lp.getSuccessors(split).get(1);
        ProjectionMap splitcProjectionMap = splitc.getProjectionMap();
        assertTrue(splitcProjectionMap.changes() == false);
    }
View Full Code Here

        planTester.buildPlan("a = load 'a';");
        LogicalPlan lp = planTester.buildPlan("b = order a by $1;");
       
        //check that the load projection map is null
        LOLoad load = (LOLoad) lp.getRoots().get(0);
        ProjectionMap loadProjectionMap = load.getProjectionMap();
        assertTrue(loadProjectionMap.changes() == false);
       
        //check that the order by projection map has null mappedFields
        LOSort sort = (LOSort)lp.getLeaves().get(0);
        ProjectionMap sortProjectionMap = sort.getProjectionMap();
        assertTrue(sortProjectionMap.changes() == false);
    }
View Full Code Here

        planTester.buildPlan("b = order a by $1;");
        LogicalPlan lp = planTester.buildPlan("c = limit b 10;");
       
        //check that the load projection map is null
        LOLoad load = (LOLoad) lp.getRoots().get(0);
        ProjectionMap loadProjectionMap = load.getProjectionMap();
        assertTrue(loadProjectionMap.changes() == false);
       
        //check that the order by projection map is not null
        LOSort sort = (LOSort)lp.getSuccessors(load).get(0);
        ProjectionMap sortProjectionMap = sort.getProjectionMap();
        assertTrue(sortProjectionMap.changes() == false);
       
        //check that the limit projection map is null
        LOLimit limit = (LOLimit)lp.getLeaves().get(0);
        ProjectionMap limitProjectionMap = limit.getProjectionMap();
        assertTrue(limitProjectionMap.changes() == false);
    }
View Full Code Here

        planTester.buildPlan("a = load 'a';");
        LogicalPlan lp = planTester.buildPlan("b = distinct a;");
       
        //check that the load projection map is null
        LOLoad load = (LOLoad) lp.getRoots().get(0);
        ProjectionMap loadProjectionMap = load.getProjectionMap();
        assertTrue(loadProjectionMap.changes() == false);
       
        //check that the distinct projection map has null mappedFields
        LODistinct distinct = (LODistinct)lp.getLeaves().get(0);
        ProjectionMap distinctProjectionMap = distinct.getProjectionMap();
        assertTrue(distinctProjectionMap.changes() == false);
    }
View Full Code Here

        String query = "stream (load 'a') through `" + simpleEchoStreamingCommand + "`;";
        LogicalPlan lp = planTester.buildPlan(query);
       
        //check that the load projection map is null
        LOLoad load = (LOLoad) lp.getRoots().get(0);
        ProjectionMap loadProjectionMap = load.getProjectionMap();
        assertTrue(loadProjectionMap.changes() == false);
       
        //check that the stream projection map is null
        LOStream stream = (LOStream)lp.getLeaves().get(0);
        ProjectionMap streamProjectionMap = stream.getProjectionMap();
        assertTrue(streamProjectionMap == null);
    }
View Full Code Here

        String query = "stream (load 'a' as (url, hitCount)) through `" + simpleEchoStreamingCommand + "` ;";
        LogicalPlan lp = planTester.buildPlan(query);
       
        //check that the load projection map is null
        LOLoad load = (LOLoad) lp.getRoots().get(0);
        ProjectionMap loadProjectionMap = load.getProjectionMap();
        assertTrue(loadProjectionMap.changes() == false);
       
        //check that the stream projection map is null
        LOStream stream = (LOStream)lp.getLeaves().get(0);
        ProjectionMap streamProjectionMap = stream.getProjectionMap();
        assertTrue(streamProjectionMap == null);
    }
View Full Code Here

TOP

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

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.