Examples of LOUnion


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

    @Test
    public void testQueryUnionNoSchema() throws FrontendException {
        String query = "c = union (load 'a'), (load 'b');";
        LogicalPlan lp = planTester.buildPlan(query);

        LOUnion union = (LOUnion)lp.getLeaves().get(0);
        RequiredFields unionRelevantFields0 = union.getRelevantInputs(0, 0).get(0);
        assertTrue(unionRelevantFields0.getNeedAllFields() == false);
        assertTrue(unionRelevantFields0.getNeedNoFields() == false);
        assertTrue(unionRelevantFields0.getFields().size() == 1);
        assertTrue(unionRelevantFields0.getFields().contains(new Pair<Integer, Integer>(0, 0)));
       
        RequiredFields unionRelevantFields1 = union.getRelevantInputs(0, 0).get(1);
        assertTrue(unionRelevantFields1.getNeedAllFields() == false);
        assertTrue(unionRelevantFields1.getNeedNoFields() == false);
        assertTrue(unionRelevantFields1.getFields().size() == 1);
        assertTrue(unionRelevantFields1.getFields().contains(new Pair<Integer, Integer>(1, 0)));
    }
View Full Code Here

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

    @Test
    public void testQueryUnionWithSchema() throws FrontendException {
        String query = "c = union (load 'a' as (url, hitcount)), (load 'b' as (url, rank));";
        LogicalPlan lp = planTester.buildPlan(query);

        LOUnion union = (LOUnion)lp.getLeaves().get(0);
        RequiredFields unionRelevantFields0 = union.getRelevantInputs(0, 0).get(0);
        assertTrue(unionRelevantFields0.getNeedAllFields() == false);
        assertTrue(unionRelevantFields0.getNeedNoFields() == false);
        assertTrue(unionRelevantFields0.getFields().size() == 1);
        assertTrue(unionRelevantFields0.getFields().contains(new Pair<Integer, Integer>(0, 0)));
       
        RequiredFields unionRelevantFields1 = union.getRelevantInputs(0, 0).get(1);
        assertTrue(unionRelevantFields1.getNeedAllFields() == false);
        assertTrue(unionRelevantFields1.getNeedNoFields() == false);
        assertTrue(unionRelevantFields1.getFields().size() == 1);
        assertTrue(unionRelevantFields1.getFields().contains(new Pair<Integer, Integer>(1, 0)));
    }
View Full Code Here

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

    @Test
    public void testQueryUnionWithMixedSchema() throws FrontendException {
        String query = "c = union (load 'a' as (url, hitcount)), (load 'b');";
        LogicalPlan lp = planTester.buildPlan(query);
        LOUnion union = (LOUnion)lp.getLeaves().get(0);
       
        RequiredFields unionRelevantFields0 = union.getRelevantInputs(0, 0).get(0);
        assertTrue(unionRelevantFields0.getNeedAllFields() == false);
        assertTrue(unionRelevantFields0.getNeedNoFields() == false);
        assertTrue(unionRelevantFields0.getFields().size() == 1);
        assertTrue(unionRelevantFields0.getFields().contains(new Pair<Integer, Integer>(0, 0)));
       
        RequiredFields unionRelevantFields1 = union.getRelevantInputs(0, 0).get(1);
        assertTrue(unionRelevantFields1.getNeedAllFields() == false);
        assertTrue(unionRelevantFields1.getNeedNoFields() == false);
        assertTrue(unionRelevantFields1.getFields().size() == 1);
        assertTrue(unionRelevantFields1.getFields().contains(new Pair<Integer, Integer>(1, 0)));
    }
View Full Code Here

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

    @Test
    public void testQueryUnionNoSchema(){
        String query = "c = union (load 'a'), (load 'b');";
        LogicalPlan lp = planTester.buildPlan(query);

        LOUnion union = (LOUnion)lp.getLeaves().get(0);
        RequiredFields unionRelevantFields0 = union.getRelevantInputs(0, 0).get(0);
        assertTrue(unionRelevantFields0.getNeedAllFields() == false);
        assertTrue(unionRelevantFields0.getNeedNoFields() == false);
        assertTrue(unionRelevantFields0.getFields().size() == 1);
        assertTrue(unionRelevantFields0.getFields().contains(new Pair<Integer, Integer>(0, 0)));
       
        RequiredFields unionRelevantFields1 = union.getRelevantInputs(0, 0).get(1);
        assertTrue(unionRelevantFields1.getNeedAllFields() == false);
        assertTrue(unionRelevantFields1.getNeedNoFields() == false);
        assertTrue(unionRelevantFields1.getFields().size() == 1);
        assertTrue(unionRelevantFields1.getFields().contains(new Pair<Integer, Integer>(1, 0)));
    }
View Full Code Here

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

    @Test
    public void testQueryUnionWithSchema(){
        String query = "c = union (load 'a' as (url, hitcount)), (load 'b' as (url, rank));";
        LogicalPlan lp = planTester.buildPlan(query);

        LOUnion union = (LOUnion)lp.getLeaves().get(0);
        RequiredFields unionRelevantFields0 = union.getRelevantInputs(0, 0).get(0);
        assertTrue(unionRelevantFields0.getNeedAllFields() == false);
        assertTrue(unionRelevantFields0.getNeedNoFields() == false);
        assertTrue(unionRelevantFields0.getFields().size() == 1);
        assertTrue(unionRelevantFields0.getFields().contains(new Pair<Integer, Integer>(0, 0)));
       
        RequiredFields unionRelevantFields1 = union.getRelevantInputs(0, 0).get(1);
        assertTrue(unionRelevantFields1.getNeedAllFields() == false);
        assertTrue(unionRelevantFields1.getNeedNoFields() == false);
        assertTrue(unionRelevantFields1.getFields().size() == 1);
        assertTrue(unionRelevantFields1.getFields().contains(new Pair<Integer, Integer>(1, 0)));
    }
View Full Code Here

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

    @Test
    public void testQueryUnionWithMixedSchema(){
        String query = "c = union (load 'a' as (url, hitcount)), (load 'b');";
        LogicalPlan lp = planTester.buildPlan(query);
        LOUnion union = (LOUnion)lp.getLeaves().get(0);
       
        RequiredFields unionRelevantFields0 = union.getRelevantInputs(0, 0).get(0);
        assertTrue(unionRelevantFields0.getNeedAllFields() == false);
        assertTrue(unionRelevantFields0.getNeedNoFields() == false);
        assertTrue(unionRelevantFields0.getFields().size() == 1);
        assertTrue(unionRelevantFields0.getFields().contains(new Pair<Integer, Integer>(0, 0)));
       
        RequiredFields unionRelevantFields1 = union.getRelevantInputs(0, 0).get(1);
        assertTrue(unionRelevantFields1.getNeedAllFields() == false);
        assertTrue(unionRelevantFields1.getNeedNoFields() == false);
        assertTrue(unionRelevantFields1.getFields().size() == 1);
        assertTrue(unionRelevantFields1.getFields().contains(new Pair<Integer, Integer>(1, 0)));
    }
View Full Code Here

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

    @Test
    public void testQueryUnionNoSchema() throws FrontendException {
        String query = "c = union (load 'a'), (load 'b');";
        LogicalPlan lp = planTester.buildPlan(query);

        LOUnion union = (LOUnion)lp.getLeaves().get(0);
        RequiredFields unionRelevantFields0 = union.getRelevantInputs(0, 0).get(0);
        assertTrue(unionRelevantFields0.getNeedAllFields() == false);
        assertTrue(unionRelevantFields0.getNeedNoFields() == false);
        assertTrue(unionRelevantFields0.getFields().size() == 1);
        assertTrue(unionRelevantFields0.getFields().contains(new Pair<Integer, Integer>(0, 0)));
       
        RequiredFields unionRelevantFields1 = union.getRelevantInputs(0, 0).get(1);
        assertTrue(unionRelevantFields1.getNeedAllFields() == false);
        assertTrue(unionRelevantFields1.getNeedNoFields() == false);
        assertTrue(unionRelevantFields1.getFields().size() == 1);
        assertTrue(unionRelevantFields1.getFields().contains(new Pair<Integer, Integer>(1, 0)));
    }
View Full Code Here

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

    @Test
    public void testQueryUnionWithSchema() throws FrontendException {
        String query = "c = union (load 'a' as (url, hitcount)), (load 'b' as (url, rank));";
        LogicalPlan lp = planTester.buildPlan(query);

        LOUnion union = (LOUnion)lp.getLeaves().get(0);
        RequiredFields unionRelevantFields0 = union.getRelevantInputs(0, 0).get(0);
        assertTrue(unionRelevantFields0.getNeedAllFields() == false);
        assertTrue(unionRelevantFields0.getNeedNoFields() == false);
        assertTrue(unionRelevantFields0.getFields().size() == 1);
        assertTrue(unionRelevantFields0.getFields().contains(new Pair<Integer, Integer>(0, 0)));
       
        RequiredFields unionRelevantFields1 = union.getRelevantInputs(0, 0).get(1);
        assertTrue(unionRelevantFields1.getNeedAllFields() == false);
        assertTrue(unionRelevantFields1.getNeedNoFields() == false);
        assertTrue(unionRelevantFields1.getFields().size() == 1);
        assertTrue(unionRelevantFields1.getFields().contains(new Pair<Integer, Integer>(1, 0)));
    }
View Full Code Here

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

    @Test
    public void testQueryUnionWithMixedSchema() throws FrontendException {
        String query = "c = union (load 'a' as (url, hitcount)), (load 'b');";
        LogicalPlan lp = planTester.buildPlan(query);
        LOUnion union = (LOUnion)lp.getLeaves().get(0);
       
        RequiredFields unionRelevantFields0 = union.getRelevantInputs(0, 0).get(0);
        assertTrue(unionRelevantFields0.getNeedAllFields() == false);
        assertTrue(unionRelevantFields0.getNeedNoFields() == false);
        assertTrue(unionRelevantFields0.getFields().size() == 1);
        assertTrue(unionRelevantFields0.getFields().contains(new Pair<Integer, Integer>(0, 0)));
       
        RequiredFields unionRelevantFields1 = union.getRelevantInputs(0, 0).get(1);
        assertTrue(unionRelevantFields1.getNeedAllFields() == false);
        assertTrue(unionRelevantFields1.getNeedNoFields() == false);
        assertTrue(unionRelevantFields1.getFields().size() == 1);
        assertTrue(unionRelevantFields1.getFields().contains(new Pair<Integer, Integer>(1, 0)));
    }
View Full Code Here

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

        fillSchema(cogroup, node.attributes) ;
        return cogroup ;
    }

    private LOUnion createLOUnion(DotNode node, LogicalPlan plan) {
        LOUnion union = new LOUnion(plan, getKey(node.attributes)) ;
        fillSchema(union, node.attributes) ;
        return union ;
    }
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.