@Test public void testJoinWithAtomicType2() throws Exception { final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); DataSet<Integer> ds1 = env.fromElements(1, 2); DataSet<Tuple3<Integer, Long, String>> ds2 = CollectionDataSets.getSmall3TupleDataSet(env); DataSet<Tuple2<Integer, Tuple3<Integer, Long, String>>> joinDs = ds1 .fullOuterJoin(ds2) .where("*") .equalTo(0) .with(new ProjectBothFunction<Integer, Tuple3<Integer, Long, String>>()) .returns(new GenericTypeInfo(Tuple2.class)); List<Tuple2<Integer, Tuple3<Integer, Long, String>>> result = joinDs.collect(); String expected = "1,(1,1,Hi)\n" + "2,(2,2,Hello)\n" + "null,(3,2,Hello world)\n"; compareResultAsTuples(result, expected); }
@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); }
inputFields[0], keyFields[0], inputFields[1], keyFields[1])) .returns(tupleJoinListsTypeInfo) .withForwardedFieldsFirst(listKeysFwd) .setParallelism(dop) .where(listKeys).equalTo(flinkKeys[i]) .with(new TupleAppendOuterJoiner(i, numJoinInputs, inputFields[i], keyFields[i])) .returns(tupleJoinListsTypeInfo) .withForwardedFieldsFirst(listKeys) .setParallelism(dop)
.withParameters(this.getFlinkNodeConfig(node)) .setParallelism(probeSideDOP) .returns(new TupleTypeInfo(outFields)) .name("hashjoin-" + node.getID()); .withParameters(this.getFlinkNodeConfig(node)) .setParallelism(probeSideDOP) .returns(new TupleTypeInfo(outFields)) .name("hashjoin-" + node.getID());
.withParameters(this.getFlinkNodeConfig(node)) .setParallelism(probeSideDOP) .returns(new TupleTypeInfo(outFields)) .name("hashjoin-" + node.getID()); .withParameters(this.getFlinkNodeConfig(node)) .setParallelism(probeSideDOP) .returns(new TupleTypeInfo(outFields)) .name("hashjoin-" + node.getID());
.equalTo(new JoinKeySelector()) .with(new BroadcastFlatJoinFunction(originalOperator.getJoiner())) .returns(new TypeHint<BatchElement<Window, Pair>>() {}) .name(operator.getName() + "::left-broadcast-hash-join"); .equalTo(new JoinKeySelector()) .with(new BroadcastFlatJoinFunction(originalOperator.getJoiner())) .returns(new TypeHint<BatchElement<Window, Pair>>() {}) .name(operator.getName() + "::right-broadcast-hash-join"); break;