/** * Finalizes a Join transformation by applying a {@link JoinFunction} to each pair of joined elements.<br/> * Each JoinFunction call returns exactly one element. * * @param function The JoinFunction that is called for each pair of joined elements. * @return An EquiJoin that represents the joined result DataSet * * @see JoinFunction * @see EquiJoin * @see DataSet */ public <R> EquiJoin<I1, I2, R> with(JoinFunction<I1, I2, R> function) { if (function == null) { throw new NullPointerException("Join function must not be null."); } TypeInformation<R> returnType = TypeExtractor.getJoinReturnTypes(function, getInput1Type(), getInput2Type()); return new EquiJoin<I1, I2, R>(getInput1(), getInput2(), getKeys1(), getKeys2(), function, returnType, getJoinHint()); }