Package org.apache.pig.data

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


    @Test
    public void testCOUNTMap() throws Exception {
        DataMap map = new DataMap();
       
        Tuple tup = new Tuple();
        tup.appendField(map);
        DataAtom output = new DataAtom();
       
       
        EvalFunc<DataAtom> count = new COUNT();
        FilterFunc isEmpty = new IsEmpty();
View Full Code Here


            groupAndTuple[0] = output.getField(0);
            groupAndTuple[1] = output.getField(1);
        } else {
            Tuple group = new Tuple();
            for (int j = 0; j < output.arity() - 1; j++) {
                group.appendField(output.getField(j));
            }
            groupAndTuple[0] = group;
            groupAndTuple[1] = output.getField(output.arity() - 1);
        }
        return groupAndTuple;
View Full Code Here

    String[] words = TutorialUtil.splitToWords(query);
    Set<String> ngrams = new HashSet<String>();
    TutorialUtil.makeNGram(words, ngrams, _ngramSizeLimit);
    for (String ngram : ngrams) {
      Tuple t = new Tuple();
      t.appendField(new DataAtom(ngram));
      arg1.add(t);
    }
  }
}
View Full Code Here

    while (it2.hasNext()) {
      String hour = it2.next();
      Long count = pairs.get(hour);
      if ( count > mean ) {
        Tuple t = new Tuple();
        t.appendField(new DataAtom(hour));
        t.appendField(new DataAtom( ((double) count - mean) / standardDeviation )); // the score
        t.appendField(new DataAtom(count));
        t.appendField(new DataAtom(mean));
        arg1.add(t);
      }
View Full Code Here

      String hour = it2.next();
      Long count = pairs.get(hour);
      if ( count > mean ) {
        Tuple t = new Tuple();
        t.appendField(new DataAtom(hour));
        t.appendField(new DataAtom( ((double) count - mean) / standardDeviation )); // the score
        t.appendField(new DataAtom(count));
        t.appendField(new DataAtom(mean));
        arg1.add(t);
      }
    }
View Full Code Here

      Long count = pairs.get(hour);
      if ( count > mean ) {
        Tuple t = new Tuple();
        t.appendField(new DataAtom(hour));
        t.appendField(new DataAtom( ((double) count - mean) / standardDeviation )); // the score
        t.appendField(new DataAtom(count));
        t.appendField(new DataAtom(mean));
        arg1.add(t);
      }
    }
   
View Full Code Here

      if ( count > mean ) {
        Tuple t = new Tuple();
        t.appendField(new DataAtom(hour));
        t.appendField(new DataAtom( ((double) count - mean) / standardDeviation )); // the score
        t.appendField(new DataAtom(count));
        t.appendField(new DataAtom(mean));
        arg1.add(t);
      }
    }
   
  }
View Full Code Here

        if (!wrapInTuple && cols.size() == 1){
            return t.getField(cols.get(0));
        }
        Tuple out = new Tuple();
        for (int i: cols){
            out.appendField(t.getField(i));
        }
        return out;
    }

    @Override
View Full Code Here

    testDataAtomEvals(eval2, getTuples(timestamps));

    DataBag bag = new DefaultDataBag();
   
    Tuple t1 = new Tuple();
    t1.appendField(new DataAtom("word"));
    t1.appendField(new DataAtom("02"));
    t1.appendField(new DataAtom(2));
    bag.add(t1);
   
    Tuple t2 = new Tuple();
View Full Code Here

    DataBag bag = new DefaultDataBag();
   
    Tuple t1 = new Tuple();
    t1.appendField(new DataAtom("word"));
    t1.appendField(new DataAtom("02"));
    t1.appendField(new DataAtom(2));
    bag.add(t1);
   
    Tuple t2 = new Tuple();
    t2.appendField(new DataAtom("word"));
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.