use of org.apache.pig.FuncSpec in project sketches-pig by DataSketches.
the class MurmurHash3Test method checkExceptions2.
@Test(expectedExceptions = IllegalArgumentException.class)
public void checkExceptions2() throws IOException {
EvalFunc<Tuple> hashUdf = (EvalFunc<Tuple>) PigContext.instantiateFuncFromSpec(new FuncSpec(hashUdfName));
Tuple in, out;
// seed must be INTEGER or LONG
in = mTupleFactory.newTuple(2);
in.set(0, new String("ABC"));
in.set(1, new Double(9001));
out = hashUdf.exec(in);
}
use of org.apache.pig.FuncSpec in project sketches-pig by DataSketches.
the class MurmurHash3Test method checkExceptions3.
@Test(expectedExceptions = IllegalArgumentException.class)
public void checkExceptions3() throws IOException {
EvalFunc<Tuple> hashUdf = (EvalFunc<Tuple>) PigContext.instantiateFuncFromSpec(new FuncSpec(hashUdfName));
Tuple in, out;
// improper hash object = Tuple
in = mTupleFactory.newTuple(1);
in.set(0, in);
out = hashUdf.exec(in);
}
use of org.apache.pig.FuncSpec in project sketches-pig by DataSketches.
the class MurmurHash3Test method checkExceptions1.
@Test
public void checkExceptions1() throws IOException {
EvalFunc<Tuple> hashUdf = (EvalFunc<Tuple>) PigContext.instantiateFuncFromSpec(new FuncSpec(hashUdfName));
Tuple in, out;
// Empty input tuple
in = mTupleFactory.newTuple(0);
out = hashUdf.exec(in);
Assert.assertNull(out);
}
Aggregations