@Test
public void testSkewedJoinUDF() throws IOException {
PartitionSkewedKeys udf = new PartitionSkewedKeys(new String[]{"0.1", "2", "1.txt"});
Tuple t = TupleFactory.getInstance().newTuple();
t.append(3); // use 3 reducers
DataBag db = new DefaultDataBag();
Tuple sample;
for (int i=0;i<=3;i++) {
sample = TupleFactory.getInstance().newTuple();
if (i!=3)
sample.append("1");
else
sample.append("2");
sample.append((long)200);
if (i!=3)
sample.append((long)0);
else
sample.append((long)30);
db.add(sample);
}
t.append(db);
Map<String, Object> output = udf.exec(t);
DataBag parList = (DataBag)output.get(PartitionSkewedKeys.PARTITION_LIST);
for (Tuple par : parList) {