/** * 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()); }
/** * Initiates a ProjectJoin transformation and projects the second join input<br/> * If the second join input is a {@link Tuple} {@link DataSet}, fields can be selected by their index. * If the second join input is not a Tuple DataSet, no parameters should be passed.<br/> * * Fields of the first and second input can be added by chaining the method calls of * {@link JoinProjection#projectFirst(int...)} and {@link JoinProjection#projectSecond(int...)}. * * @param fieldIndexes If the second input is a Tuple DataSet, the indexes of the selected fields. * For a non-Tuple DataSet, do not provide parameters. * The order of fields in the output tuple is defined by to the order of field indexes. * @return A JoinProjection that needs to be converted into a {@link ProjectJoin} to complete the * Join transformation by calling {@link JoinProjection#types()}. * * @see Tuple * @see DataSet * @see JoinProjection * @see ProjectJoin */ public JoinProjection<I1, I2> projectSecond(int... secondFieldIndexes) { return new JoinProjection<I1, I2>(getInput1(), getInput2(), getKeys1(), getKeys2(), getJoinHint(), null, secondFieldIndexes); }
/** * Initiates a ProjectJoin transformation and projects the first join input<br/> * If the first join input is a {@link Tuple} {@link DataSet}, fields can be selected by their index. * If the first join input is not a Tuple DataSet, no parameters should be passed.<br/> * * Fields of the first and second input can be added by chaining the method calls of * {@link JoinProjection#projectFirst(int...)} and {@link JoinProjection#projectSecond(int...)}. * * @param firstFieldIndexes If the first input is a Tuple DataSet, the indexes of the selected fields. * For a non-Tuple DataSet, do not provide parameters. * The order of fields in the output tuple is defined by to the order of field indexes. * @return A JoinProjection that needs to be converted into a {@link ProjectJoin} to complete the * Join transformation by calling {@link JoinProjection#types()}. * * @see Tuple * @see DataSet * @see JoinProjection * @see ProjectJoin */ public JoinProjection<I1, I2> projectFirst(int... firstFieldIndexes) { return new JoinProjection<I1, I2>(getInput1(), getInput2(), getKeys1(), getKeys2(), getJoinHint(), firstFieldIndexes, null); }