use of org.apache.pig.EvalFunc in project sketches-pig by DataSketches.
the class UnionSketchTest method algebraicFinalNullInputTuple.
@Test
public void algebraicFinalNullInputTuple() throws Exception {
@SuppressWarnings("unchecked") EvalFunc<DataByteArray> func = (EvalFunc<DataByteArray>) Class.forName(new UnionSketch().getFinal()).newInstance();
DataByteArray result = func.exec(null);
HllSketch sketch = DataToSketchTest.getSketch(result);
Assert.assertTrue(sketch.isEmpty());
}
use of org.apache.pig.EvalFunc in project sketches-pig by DataSketches.
the class UnionSketchTest method algebraicIntermediateNullInputTuple.
@Test
public void algebraicIntermediateNullInputTuple() throws Exception {
@SuppressWarnings("unchecked") EvalFunc<Tuple> func = (EvalFunc<Tuple>) Class.forName(new UnionSketch().getIntermed()).newInstance();
Tuple result = func.exec(null);
HllSketch sketch = DataToSketchTest.getSketch((DataByteArray) result.get(0));
Assert.assertTrue(sketch.isEmpty());
}
use of org.apache.pig.EvalFunc in project sketches-pig by DataSketches.
the class DataToStringsSketchTest method algebraicIntermediateFinalNullInputTuple.
@Test
public void algebraicIntermediateFinalNullInputTuple() throws Exception {
@SuppressWarnings("unchecked") EvalFunc<Tuple> func = (EvalFunc<Tuple>) Class.forName(new DataToStringsSketch().getIntermed()).newInstance();
Tuple resultTuple = func.exec(null);
ItemsSketch<String> sketch = getSketch(resultTuple);
Assert.assertTrue(sketch.isEmpty());
}
use of org.apache.pig.EvalFunc in project sketches-pig by DataSketches.
the class DataToStringsSketchTest method algebraicIntermediateFinalEmptyInputTuple.
@Test
public void algebraicIntermediateFinalEmptyInputTuple() throws Exception {
@SuppressWarnings("unchecked") EvalFunc<Tuple> func = (EvalFunc<Tuple>) Class.forName(new DataToStringsSketch().getIntermed()).newInstance();
Tuple resultTuple = func.exec(TUPLE_FACTORY.newTuple());
ItemsSketch<String> sketch = getSketch(resultTuple);
Assert.assertTrue(sketch.isEmpty());
}
use of org.apache.pig.EvalFunc in project sketches-pig by DataSketches.
the class MurmurHash3Test method check3ValidArgs.
@Test
public void check3ValidArgs() throws IOException {
EvalFunc<Tuple> hashUdf = (EvalFunc<Tuple>) PigContext.instantiateFuncFromSpec(new FuncSpec(hashUdfName));
Tuple in, out;
// test multiple integers, seed
in = mTupleFactory.newTuple(3);
for (int i = 0; i < 10; i++) {
in.set(0, i);
in.set(1, 9001);
in.set(2, 7);
out = hashUdf.exec(in);
checkOutput(out, true);
}
}
Aggregations