use of co.cask.cdap.dq.functions.UniqueValues in project cdap by caskdata.
the class AggregationFunctionsTest method uniqueValuesGenerateAggregationTest.
@Test
public void uniqueValuesGenerateAggregationTest() throws Exception {
DataQualityWritable val1 = new DataQualityWritable();
DataQualityWritable val2 = new DataQualityWritable();
DataQualityWritable val3 = new DataQualityWritable();
val1.set(new Text("a"));
val2.set(new Text("a"));
val3.set(new Text("a"));
UniqueValues uniqueValues = new UniqueValues();
uniqueValues.add(val1);
uniqueValues.add(val2);
uniqueValues.add(val3);
byte[] output = uniqueValues.aggregate();
Assert.assertEquals("[a]", Bytes.toString(output));
}
Aggregations