use of org.apache.flink.api.java.typeutils.GenericTypeInfo in project flink by apache.
the class OuterJoinITCase method testJoinWithAtomicType1.
@Test
public void testJoinWithAtomicType1() throws Exception {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Tuple3<Integer, Long, String>> ds1 = CollectionDataSets.getSmall3TupleDataSet(env);
DataSet<Integer> ds2 = env.fromElements(1, 2);
DataSet<Tuple2<Tuple3<Integer, Long, String>, Integer>> joinDs = ds1.fullOuterJoin(ds2).where(0).equalTo("*").with(new ProjectBothFunction<Tuple3<Integer, Long, String>, Integer>()).returns(new GenericTypeInfo(Tuple2.class));
List<Tuple2<Tuple3<Integer, Long, String>, Integer>> result = joinDs.collect();
String expected = "(1,1,Hi),1\n" + "(2,2,Hello),2\n" + "(3,2,Hello world),null\n";
compareResultAsTuples(result, expected);
}
Aggregations