Search in sources :

Example 1 with PojoWithDateAndEnum

use of org.apache.flink.test.javaApiOperators.util.CollectionDataSets.PojoWithDateAndEnum in project flink by apache.

the class ReduceITCase method testSupportForDataAndEnumSerialization.

@Test
public void testSupportForDataAndEnumSerialization() throws Exception {
    /**
		 * Test support for Date and enum serialization
		 */
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<PojoWithDateAndEnum> ds = env.generateSequence(0, 2).map(new Mapper1());
    ds = ds.union(CollectionDataSets.getPojoWithDateAndEnum(env));
    DataSet<String> res = ds.groupBy("group").reduceGroup(new GroupReducer1());
    List<String> result = res.collect();
    String expected = "ok\nok";
    compareResultAsText(result, expected);
}
Also used : PojoWithDateAndEnum(org.apache.flink.test.javaApiOperators.util.CollectionDataSets.PojoWithDateAndEnum) ExecutionEnvironment(org.apache.flink.api.java.ExecutionEnvironment) Test(org.junit.Test)

Aggregations

ExecutionEnvironment (org.apache.flink.api.java.ExecutionEnvironment)1 PojoWithDateAndEnum (org.apache.flink.test.javaApiOperators.util.CollectionDataSets.PojoWithDateAndEnum)1 Test (org.junit.Test)1