Examples of ProjectSpec


Examples of org.apache.pig.impl.eval.ProjectSpec

        DataBag outputData = derivedData.get(op);
        DataBag inputData = derivedData.get(inputOp);

        EvalSpec spec = op.getSpec();
        if (spec instanceof ProjectSpec) {
            ProjectSpec pSpec = (ProjectSpec) spec;
            List<Integer> cols = pSpec.getCols();

            if (outputConstraints.cardinality() > 0) {   // there's one or more output constraints; propagate them backwards through the projection
                for (Iterator<Tuple> it = outputConstraints.iterator(); it.hasNext(); ) {
                    Tuple outputConstraint = it.next();
                    Tuple inputConst = BackPropConstraint(outputConstraint, cols, inputSchema);
View Full Code Here

Examples of org.apache.pig.impl.eval.ProjectSpec

        //find the quantiles in the reduce step
        ArrayList<EvalSpec> argsList = new ArrayList<EvalSpec>();
        argsList.add(new ConstSpec(Math.max(loSort.getRequestedParallelism()-1,1)));
       
        //sort the first column of the cogroup output and feed it to the quantiles function
        EvalSpec sortedSampleSpec = new ProjectSpec(1);
        EvalSpec starSpec = new StarSpec();
        starSpec.setComparatorName(loSort.getSortSpec().getComparatorName());
        sortedSampleSpec = sortedSampleSpec.addSpec(new SortDistinctSpec(false, starSpec));
        argsList.add(sortedSampleSpec);
       
        EvalSpec args = new GenerateSpec(argsList);

        EvalSpec reduceSpec = new FuncEvalSpec(pigContext, FindQuantiles.class.getName(), args);
View Full Code Here

Examples of org.apache.pig.impl.eval.ProjectSpec

        groupFuncs.add(new GenerateSpec(loSort.getSortSpec()).getGroupBySpec());
       
        sortJob.groupFuncs = groupFuncs;
        sortJob.partitionFunction = SortPartitioner.class;
       
        ProjectSpec ps = new ProjectSpec(1);
        ps.setFlatten(true);
        sortJob.addReduceSpec(new GenerateSpec(ps));
   
        sortJob.reduceParallelism = loSort.getRequestedParallelism();
       
        String comparatorFuncName = loSort.getSortSpec().getComparatorName();
View Full Code Here

Examples of org.apache.pig.impl.eval.ProjectSpec

        if (!i.hasNext()) return false;
        EvalSpec s = i.next();
        if (!(s instanceof ProjectSpec)) {
            return false;
        } else {
            ProjectSpec p = (ProjectSpec)s;
            if (p.numCols() > 1) return false;
            else if (p.getCol() != 0) return false;
        }

        // Third, all subsequent immediate children of the generate spec
        // must be func eval specs
        while (i.hasNext()) {
View Full Code Here

Examples of org.apache.pig.impl.eval.ProjectSpec

            // lop off.
            // The first ProjectSpec in the Composite is because the tuples
            // will come out of the combiner in the form (groupkey,
            // {(x, y, z)}).  The second ProjectSpec contains the offset of
            // the projection element we're interested in.
            CompositeEvalSpec cs = new CompositeEvalSpec(new ProjectSpec(1));
            cs.addSpec(new ProjectSpec(position));
            fe.setArgs(new GenerateSpec(cs));


            // Reset the function to call the final instance of itself
            // instead of the general instance.  Have to instantiate the
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.