Examples of needAllFields()


Examples of org.apache.pig.impl.plan.RequiredFields.needAllFields()

        assertTrue(cogroupRelevantFields1.getNeedNoFields() == false);
       
        LOForEach foreach = (LOForEach)lp.getSuccessors(cogroup).get(0);
        RequiredFields foreachRelevantFields0 = foreach.getRelevantInputs(0, 0).get(0);
        assertTrue(foreachRelevantFields0.needNoFields() == false);
        assertTrue(foreachRelevantFields0.needAllFields() == false);
        assertTrue(foreachRelevantFields0.getFields().size() == 1);
        assertTrue(foreachRelevantFields0.getFields().get(0).first == 0);
        assertTrue(foreachRelevantFields0.getFields().get(0).second == 1);
       
        assertTrue(foreach.getRelevantInputs(0, 1) == null);
View Full Code Here

Examples of org.apache.pig.impl.plan.RequiredFields.needAllFields()

        planTester.buildPlan("a = load 'a' as (url, hitCount);");
        LogicalPlan lp = planTester.buildPlan("split a into b if url == '3', c if COUNT(*) == '3';");
       
        LOSplit split = (LOSplit)lp.getSuccessors(lp.getRoots().get(0)).get(0);
        RequiredFields splitRelevantFields0 = split.getRelevantInputs(0, 0).get(0);
        assertTrue(splitRelevantFields0.needAllFields() == false);
        assertTrue(splitRelevantFields0.needNoFields() == false);
        assertTrue(splitRelevantFields0.getFields().size() == 1);
        assertTrue(splitRelevantFields0.getFields().contains(new Pair<Integer, Integer>(0, 0)));
       
        RequiredFields splitRelevantFields1 = split.getRelevantInputs(0, 1).get(0);
View Full Code Here

Examples of org.apache.pig.impl.plan.RequiredFields.needAllFields()

                        // only a group by can have a single input
                        return false;
                    }
                }

                if (requiredField.needAllFields()) {
                    return false;
                }

                Pair<Boolean, Set<Integer>> mappingResult = isRequiredFieldMapped(requiredField, predecessor.getProjectionMap());
                boolean mapped = mappingResult.first;
View Full Code Here

Examples of org.apache.pig.impl.plan.RequiredFields.needAllFields()

            // element and process
            RequiredFields requiredOutputFields = requiredOutputInfo.requiredFieldsList.get(0);
           
            // needAllFields means we require every individual output column and all map keys of that output.
            // We convert needAllFields to individual fields here to facilitate further processing
            if (requiredOutputFields.needAllFields())
            {
                List<Pair<Integer, Integer>> outputList = new ArrayList<Pair<Integer, Integer>>();
                for (int j=0;j<rlo.getSchema().size();j++)
                    outputList.add(new Pair<Integer, Integer>(0, j));
                requiredOutputFields = new RequiredFields(outputList);
View Full Code Here

Examples of org.apache.pig.impl.plan.RequiredFields.needAllFields()

               
                for (int j=0;j<relevantFieldsList.size();j++)
                {
                    RequiredFields relevantFields = relevantFieldsList.get(j);
                   
                    if (relevantFields!=null && relevantFields.needAllFields())
                    {
                        requiredInputFieldsList.set(j, new RequiredFields(true));
                        continue;
                    }
                   
View Full Code Here

Examples of org.apache.pig.impl.plan.RequiredFields.needAllFields()

                    }
                   
                    // Mapping output map keys to input map keys
                    if (rlo instanceof LOCogroup)
                    {
                        if (j!=0 && relevantFields!=null && !relevantFields.needAllFields())
                        {
                            for (Pair<Integer, Integer> pair : relevantFields.getFields())
                                relevantFields.setMapKeysInfo(pair.first, pair.second,
                                        new MapKeysInfo(true));
                        }
View Full Code Here

Examples of org.apache.pig.impl.plan.RequiredFields.needAllFields()

        List<RequiredFields> loadRequiredFields = load.getRequiredFields();
        assertTrue(loadRequiredFields.size() == 1);
       
        RequiredFields requiredField = loadRequiredFields.get(0);
        assertTrue(requiredField.needNoFields() == true);
        assertTrue(requiredField.needAllFields() == false);
        assertTrue(requiredField.getFields() == null);
       
        //check that the foreach required fields contain [<0, 1>, <0, 2>]
        LOForEach foreach = (LOForEach)lp.getLeaves().get(0);
        List<RequiredFields> foreachRequiredFields = foreach.getRequiredFields();
View Full Code Here

Examples of org.apache.pig.impl.plan.RequiredFields.needAllFields()

        List<RequiredFields> foreachRequiredFields = foreach.getRequiredFields();
        assertTrue(foreachRequiredFields.size() == 1);
       
        requiredField = foreachRequiredFields.get(0);
        assertTrue(requiredField.needNoFields() == false);
        assertTrue(requiredField.needAllFields() == false);

        List<Pair<Integer, Integer>> fields = requiredField.getFields();
        assertTrue(fields.size() == 2);
        assertTrue(fields.get(0).first == 0);
        assertTrue(fields.get(0).second == 1);
View Full Code Here

Examples of org.apache.pig.impl.plan.RequiredFields.needAllFields()

        List<RequiredFields> loadRequiredFields = load.getRequiredFields();
        assertTrue(loadRequiredFields.size() == 1);
       
        RequiredFields requiredField = loadRequiredFields.get(0);
        assertTrue(requiredField.needNoFields() == true);
        assertTrue(requiredField.needAllFields() == false);
        assertTrue(requiredField.getFields() == null);
       
        //check that the foreach required fields contain [<0, 1>]
        LOForEach foreach = (LOForEach)lp.getLeaves().get(0);
        List<RequiredFields> foreachRequiredFields = foreach.getRequiredFields();
View Full Code Here

Examples of org.apache.pig.impl.plan.RequiredFields.needAllFields()

        List<RequiredFields> foreachRequiredFields = foreach.getRequiredFields();
        assertTrue(foreachRequiredFields.size() == 1);
       
        requiredField = foreachRequiredFields.get(0);
        assertTrue(requiredField.needNoFields() == false);
        assertTrue(requiredField.needAllFields() == false);

        List<Pair<Integer, Integer>> fields = requiredField.getFields();
        assertTrue(fields.size() == 1);
        assertTrue(fields.get(0).first == 0);
        assertTrue(fields.get(0).second == 1);
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.