public <R> EquiJoin<I1, I2, R> with(JoinFunction<I1, I2, R> function) { if (function == null) { throw new NullPointerException("Join function must not be null."); } FlatJoinFunction<I1, I2, R> generatedFunction = new WrappingFlatJoinFunction<>(clean(function)); TypeInformation<R> returnType = TypeExtractor.getJoinReturnTypes(function, getInput1Type(), getInput2Type(), Utils.getCallLocationName(), true); return new EquiJoin<>(getInput1(), getInput2(), getKeys1(), getKeys2(), generatedFunction, function, returnType, getJoinHint(), Utils.getCallLocationName(), joinType); }
/** * Finalizes a Join transformation by applying a {@link org.apache.flink.api.common.functions.RichFlatJoinFunction} to each pair of joined elements. * * <p>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 org.apache.flink.api.common.functions.RichFlatJoinFunction * @see org.apache.flink.api.java.operators.JoinOperator.EquiJoin * @see DataSet */ public <R> EquiJoin<I1, I2, R> with(FlatJoinFunction<I1, I2, R> function) { if (function == null) { throw new NullPointerException("Join function must not be null."); } TypeInformation<R> returnType = TypeExtractor.getFlatJoinReturnTypes(function, getInput1Type(), getInput2Type(), Utils.getCallLocationName(), true); return new EquiJoin<>(getInput1(), getInput2(), getKeys1(), getKeys2(), clean(function), returnType, getJoinHint(), Utils.getCallLocationName(), joinType); }
public <R> EquiJoin<I1, I2, R> with(JoinFunction<I1, I2, R> function) { if (function == null) { throw new NullPointerException("Join function must not be null."); } FlatJoinFunction<I1, I2, R> generatedFunction = new WrappingFlatJoinFunction<>(clean(function)); TypeInformation<R> returnType = TypeExtractor.getJoinReturnTypes(function, getInput1Type(), getInput2Type(), Utils.getCallLocationName(), true); return new EquiJoin<>(getInput1(), getInput2(), getKeys1(), getKeys2(), generatedFunction, function, returnType, getJoinHint(), Utils.getCallLocationName(), joinType); }
/** * Applies a ProjectJoin transformation and projects the second join input * * <p>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. * * <p>Fields of the first and second input can be added by chaining the method calls of * {@link org.apache.flink.api.java.operators.JoinOperator.ProjectJoin#projectFirst(int...)} and * {@link org.apache.flink.api.java.operators.JoinOperator.ProjectJoin#projectSecond(int...)}. * * <p><b>Note: With the current implementation, the Project transformation loses type information.</b> * * @param secondFieldIndexes 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 ProjectJoin which represents the projected join result. * * @see Tuple * @see DataSet * @see org.apache.flink.api.java.operators.JoinOperator.ProjectJoin */ public <OUT extends Tuple> ProjectJoin<I1, I2, OUT> projectSecond(int... secondFieldIndexes) { JoinProjection<I1, I2> joinProjection = new JoinProjection<>(getInput1(), getInput2(), getKeys1(), getKeys2(), getJoinHint(), null, secondFieldIndexes); return joinProjection.projectTupleX(); }
/** * Applies a ProjectJoin transformation and projects the first join input * * <p>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. * * <p>Fields of the first and second input can be added by chaining the method calls of * {@link org.apache.flink.api.java.operators.JoinOperator.ProjectJoin#projectFirst(int...)} and * {@link org.apache.flink.api.java.operators.JoinOperator.ProjectJoin#projectSecond(int...)}. * * <b>Note: With the current implementation, the Project transformation loses type information.</b> * * @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 ProjectJoin which represents the projected join result. * * @see Tuple * @see DataSet * @see org.apache.flink.api.java.operators.JoinOperator.ProjectJoin */ public <OUT extends Tuple> ProjectJoin<I1, I2, OUT> projectFirst(int... firstFieldIndexes) { JoinProjection<I1, I2> joinProjection = new JoinProjection<>(getInput1(), getInput2(), getKeys1(), getKeys2(), getJoinHint(), firstFieldIndexes, null); return joinProjection.projectTupleX(); }
/** * Applies a ProjectJoin transformation and projects the first join input * * <p>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. * * <p>Fields of the first and second input can be added by chaining the method calls of * {@link org.apache.flink.api.java.operators.JoinOperator.ProjectJoin#projectFirst(int...)} and * {@link org.apache.flink.api.java.operators.JoinOperator.ProjectJoin#projectSecond(int...)}. * * <b>Note: With the current implementation, the Project transformation loses type information.</b> * * @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 ProjectJoin which represents the projected join result. * * @see Tuple * @see DataSet * @see org.apache.flink.api.java.operators.JoinOperator.ProjectJoin */ public <OUT extends Tuple> ProjectJoin<I1, I2, OUT> projectFirst(int... firstFieldIndexes) { JoinProjection<I1, I2> joinProjection = new JoinProjection<>(getInput1(), getInput2(), getKeys1(), getKeys2(), getJoinHint(), firstFieldIndexes, null); return joinProjection.projectTupleX(); }
/** * Applies a ProjectJoin transformation and projects the second join input * * <p>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. * * <p>Fields of the first and second input can be added by chaining the method calls of * {@link org.apache.flink.api.java.operators.JoinOperator.ProjectJoin#projectFirst(int...)} and * {@link org.apache.flink.api.java.operators.JoinOperator.ProjectJoin#projectSecond(int...)}. * * <p><b>Note: With the current implementation, the Project transformation loses type information.</b> * * @param secondFieldIndexes 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 ProjectJoin which represents the projected join result. * * @see Tuple * @see DataSet * @see org.apache.flink.api.java.operators.JoinOperator.ProjectJoin */ public <OUT extends Tuple> ProjectJoin<I1, I2, OUT> projectSecond(int... secondFieldIndexes) { JoinProjection<I1, I2> joinProjection = new JoinProjection<>(getInput1(), getInput2(), getKeys1(), getKeys2(), getJoinHint(), null, secondFieldIndexes); return joinProjection.projectTupleX(); }
/** * Finalizes a Join transformation by applying a {@link org.apache.flink.api.common.functions.RichFlatJoinFunction} to each pair of joined elements. * * <p>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 org.apache.flink.api.common.functions.RichFlatJoinFunction * @see org.apache.flink.api.java.operators.JoinOperator.EquiJoin * @see DataSet */ public <R> EquiJoin<I1, I2, R> with(FlatJoinFunction<I1, I2, R> function) { if (function == null) { throw new NullPointerException("Join function must not be null."); } TypeInformation<R> returnType = TypeExtractor.getFlatJoinReturnTypes(function, getInput1Type(), getInput2Type(), Utils.getCallLocationName(), true); return new EquiJoin<>(getInput1(), getInput2(), getKeys1(), getKeys2(), clean(function), returnType, getJoinHint(), Utils.getCallLocationName(), joinType); }
/** * Finalizes a Join transformation by applying a {@link org.apache.flink.api.common.functions.RichFlatJoinFunction} to each pair of joined elements. * * <p>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 org.apache.flink.api.common.functions.RichFlatJoinFunction * @see org.apache.flink.api.java.operators.JoinOperator.EquiJoin * @see DataSet */ public <R> EquiJoin<I1, I2, R> with(FlatJoinFunction<I1, I2, R> function) { if (function == null) { throw new NullPointerException("Join function must not be null."); } TypeInformation<R> returnType = TypeExtractor.getFlatJoinReturnTypes(function, getInput1Type(), getInput2Type(), Utils.getCallLocationName(), true); return new EquiJoin<>(getInput1(), getInput2(), getKeys1(), getKeys2(), clean(function), returnType, getJoinHint(), Utils.getCallLocationName(), joinType); }
public <R> EquiJoin<I1, I2, R> with(JoinFunction<I1, I2, R> function) { if (function == null) { throw new NullPointerException("Join function must not be null."); } FlatJoinFunction<I1, I2, R> generatedFunction = new WrappingFlatJoinFunction<>(clean(function)); TypeInformation<R> returnType = TypeExtractor.getJoinReturnTypes(function, getInput1Type(), getInput2Type(), Utils.getCallLocationName(), true); return new EquiJoin<>(getInput1(), getInput2(), getKeys1(), getKeys2(), generatedFunction, function, returnType, getJoinHint(), Utils.getCallLocationName(), joinType); }
/** * Applies a ProjectJoin transformation and projects the second join input * * <p>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. * * <p>Fields of the first and second input can be added by chaining the method calls of * {@link org.apache.flink.api.java.operators.JoinOperator.ProjectJoin#projectFirst(int...)} and * {@link org.apache.flink.api.java.operators.JoinOperator.ProjectJoin#projectSecond(int...)}. * * <p><b>Note: With the current implementation, the Project transformation loses type information.</b> * * @param secondFieldIndexes 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 ProjectJoin which represents the projected join result. * * @see Tuple * @see DataSet * @see org.apache.flink.api.java.operators.JoinOperator.ProjectJoin */ public <OUT extends Tuple> ProjectJoin<I1, I2, OUT> projectSecond(int... secondFieldIndexes) { JoinProjection<I1, I2> joinProjection = new JoinProjection<>(getInput1(), getInput2(), getKeys1(), getKeys2(), getJoinHint(), null, secondFieldIndexes); return joinProjection.projectTupleX(); }
/** * Applies a ProjectJoin transformation and projects the first join input * * <p>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. * * <p>Fields of the first and second input can be added by chaining the method calls of * {@link org.apache.flink.api.java.operators.JoinOperator.ProjectJoin#projectFirst(int...)} and * {@link org.apache.flink.api.java.operators.JoinOperator.ProjectJoin#projectSecond(int...)}. * * <b>Note: With the current implementation, the Project transformation loses type information.</b> * * @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 ProjectJoin which represents the projected join result. * * @see Tuple * @see DataSet * @see org.apache.flink.api.java.operators.JoinOperator.ProjectJoin */ public <OUT extends Tuple> ProjectJoin<I1, I2, OUT> projectFirst(int... firstFieldIndexes) { JoinProjection<I1, I2> joinProjection = new JoinProjection<>(getInput1(), getInput2(), getKeys1(), getKeys2(), getJoinHint(), firstFieldIndexes, null); return joinProjection.projectTupleX(); }