Package org.apache.pig.data

Examples of org.apache.pig.data.Tuple.copyFrom()


    // HELPER METHODS:
   
    static Tuple GenerateGroupByInput(Datum groupLabel, List<Integer> groupCols, int numInputFields) throws IOException {
        Tuple inputConst = new Tuple(numInputFields);
      Tuple inputConstraint = new ExampleTuple();
      inputConstraint.copyFrom(inputConst);
        if (groupLabel != null) {
            if (groupCols.size() == 1) {   // group by one column, so group label is a data atom
                inputConstraint.setField(groupCols.get(0), groupLabel);
            } else {                       // group by multiple columns, so group label is a tuple
                if (!(groupLabel instanceof Tuple)) throw new RuntimeException("Unexpected group label type.");
View Full Code Here


    }

    static Tuple BackPropConstraint(Tuple outputConstraint, List<Integer> cols, TupleSchema inputSchema) throws IOException {
        Tuple inputConst = new Tuple(inputSchema.numFields());
        Tuple inputConstraint = new ExampleTuple();
        inputConstraint.copyFrom(inputConst);

        for (int outCol = 0; outCol < outputConstraint.arity(); outCol++) {
            int inCol = cols.get(outCol);
            Datum outVal = outputConstraint.getField(outCol);
            Datum inVal = inputConstraint.getField(inCol);
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.