Java Code Examples for org.apache.flink.test.operators.util.CollectionDataSets#PojoWithMultiplePojos
The following examples show how to use
org.apache.flink.test.operators.util.CollectionDataSets#PojoWithMultiplePojos .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GroupReduceITCase.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Test public void testGroupingWithPojoContainingMultiplePojos() throws Exception { /* * Test grouping with pojo containing multiple pojos (was a bug) */ final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(1); DataSet<CollectionDataSets.PojoWithMultiplePojos> ds = CollectionDataSets.getPojoWithMultiplePojos(env); // f0.f0 is first integer DataSet<String> reduceDs = ds.groupBy("p2.a2") .reduceGroup(new GroupReducer6()); List<String> result = reduceDs.collect(); String expected = "b\nccc\nee\n"; compareResultAsText(result, expected); }
Example 2
Source File: GroupReduceITCase.java From flink with Apache License 2.0 | 6 votes |
@Test public void testGroupingWithPojoContainingMultiplePojos() throws Exception { /* * Test grouping with pojo containing multiple pojos (was a bug) */ final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(1); DataSet<CollectionDataSets.PojoWithMultiplePojos> ds = CollectionDataSets.getPojoWithMultiplePojos(env); // f0.f0 is first integer DataSet<String> reduceDs = ds.groupBy("p2.a2") .reduceGroup(new GroupReducer6()); List<String> result = reduceDs.collect(); String expected = "b\nccc\nee\n"; compareResultAsText(result, expected); }
Example 3
Source File: GroupReduceITCase.java From flink with Apache License 2.0 | 6 votes |
@Test public void testGroupingWithPojoContainingMultiplePojos() throws Exception { /* * Test grouping with pojo containing multiple pojos (was a bug) */ final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(1); DataSet<CollectionDataSets.PojoWithMultiplePojos> ds = CollectionDataSets.getPojoWithMultiplePojos(env); // f0.f0 is first integer DataSet<String> reduceDs = ds.groupBy("p2.a2") .reduceGroup(new GroupReducer6()); List<String> result = reduceDs.collect(); String expected = "b\nccc\nee\n"; compareResultAsText(result, expected); }
Example 4
Source File: GroupReduceITCase.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Override public void reduce( Iterable<CollectionDataSets.PojoWithMultiplePojos> values, Collector<String> out) throws Exception { StringBuilder concat = new StringBuilder(); for (CollectionDataSets.PojoWithMultiplePojos value : values) { concat.append(value.p2.a2); } out.collect(concat.toString()); }
Example 5
Source File: GroupReduceITCase.java From flink with Apache License 2.0 | 5 votes |
@Override public void reduce( Iterable<CollectionDataSets.PojoWithMultiplePojos> values, Collector<String> out) throws Exception { StringBuilder concat = new StringBuilder(); for (CollectionDataSets.PojoWithMultiplePojos value : values) { concat.append(value.p2.a2); } out.collect(concat.toString()); }
Example 6
Source File: GroupReduceITCase.java From flink with Apache License 2.0 | 5 votes |
@Override public void reduce( Iterable<CollectionDataSets.PojoWithMultiplePojos> values, Collector<String> out) throws Exception { StringBuilder concat = new StringBuilder(); for (CollectionDataSets.PojoWithMultiplePojos value : values) { concat.append(value.p2.a2); } out.collect(concat.toString()); }