/** * 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()); }
.where(1) .equalTo(1) .with(new T3T5Join()); .where(0,1) .equalTo(0,4) .with(new T3T5Join()); .where(1) .equalTo(1) .with(new T3T5Join()); .where(1) .equalTo(1) .with(new T3T5Join()); .where(1) .equalTo(1) .with(new LeftReturningJoin()); .where(1) .equalTo(1) .with(new RightReturningJoin()); .where(1) .equalTo(4) .with(new T3T5BCJoin()) .withBroadcastSet(intDs, "ints");
ordersFilteredByYear.joinWithHuge(lineitemsFilteredByFlag) .where(0).equalTo(0) .projectFirst(1).projectSecond(1,2) .types(Integer.class, Double.class, Double.class); .joinWithTiny(nations) .where(3).equalTo(0) .projectFirst(0,1,2).projectSecond(1).projectFirst(4) .types(Integer.class, String.class, String.class, String.class, Double.class); customerWithNation.join(revenueOfCustomerKey) .where(0).equalTo(0) .projectFirst(0,1,2,3,4).projectSecond(1) .types(Integer.class, String.class, String.class, String.class, Double.class, Double.class);
ordersFilteredByYear.joinWithHuge(lineitemsFilteredByFlag) .where(0).equalTo(0) .projectFirst(1).projectSecond(1,2) .types(Integer.class, Double.class, Double.class); .joinWithTiny(nations) .where(3).equalTo(0) .projectFirst(0,1,2).projectSecond(1).projectFirst(4) .types(Integer.class, String.class, String.class, String.class, Double.class); customerWithNation.join(revenueOfCustomerKey) .where(0).equalTo(0) .projectFirst(0,1,2,3,4).projectSecond(1) .types(Integer.class, String.class, String.class, String.class, Double.class, Double.class);
ordersFilteredByYear.joinWithHuge(lineitems) .where(0).equalTo(0) .projectFirst(0,1).projectSecond(1) .types(Integer.class, Integer.class, Double.class);
ordersFilteredByYear.joinWithHuge(lineitems) .where(0).equalTo(0) .projectFirst(0,1).projectSecond(1) .types(Integer.class, Integer.class, Double.class);
filterDocs.join(filterRanks) .where(0).equalTo(1) .projectSecond(0,1,2) .types(Integer.class, String.class, Integer.class);
filterDocs.join(filterRanks) .where(0).equalTo(1) .projectSecond(0,1,2) .types(Integer.class, String.class, Integer.class);
.join(edgesById).where(Triad.V2,Triad.V3).equalTo(Edge.V1,Edge.V2).with(new TriadFilter());
.join(edgesById).where(Triad.V2,Triad.V3).equalTo(Edge.V1,Edge.V2).with(new TriadFilter());
.with(new FindCandidatesJoin()) .groupBy(new KeySelector<Long, Long>() { public Long getKey(Long id) { return id; } public Long getKey(Tuple2<Long, Long> vertexWithId) { return vertexWithId.f1; } }).with(new FindCandidatesDependenciesJoin()); .with(new NeighborWithComponentIDJoin()) .groupBy(0).reduceGroup(new MinimumReduce()); .flatMap(new MinimumIdFilter());
.join(edgesById).where(Triad.V2, Triad.V3).equalTo(Edge.V1, Edge.V2).with(new TriadFilter());
/** * 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); }