Interface FlatJoinFunction<IN1,IN2,OUT>
-
- Type Parameters:
IN1
- The type of the elements in the first input.IN2
- The type of the elements in the second input.OUT
- The type of the result elements.
- All Superinterfaces:
Function
,Serializable
- All Known Implementing Classes:
IntervalJoinFunction
,RichFlatJoinFunction
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@Public @FunctionalInterface public interface FlatJoinFunction<IN1,IN2,OUT> extends Function, Serializable
Interface for Join functions. Joins combine two data sets by joining their elements on specified keys. This function is called with each pair of joining elements.This particular variant of the join function supports to return zero, one, or more result values per pair of joining values.
By default, the joins follows strictly the semantics of an "inner join" in SQL. the semantics are those of an "inner join", meaning that elements are filtered out if their key is not contained in the other data set.
The basic syntax for using Join on two data sets is as follows:
DataSet<X> set1 = ...; DataSet<Y> set2 = ...; set1.join(set2).where(<key-definition>).equalTo(<key-definition>).with(new MyJoinFunction());
set1
is here considered the first input,set2
the second input.The Join function is an optional part of a join operation. If no JoinFunction is provided, the result of the operation is a sequence of 2-tuples, where the elements in the tuple are those that the JoinFunction would have been invoked with.
Note: You can use a
CoGroupFunction
to perform an outer join.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
join(IN1 first, IN2 second, Collector<OUT> out)
The join method, called once per joined pair of elements.
-
-
-
Method Detail
-
join
void join(IN1 first, IN2 second, Collector<OUT> out) throws Exception
The join method, called once per joined pair of elements.- Parameters:
first
- The element from first input.second
- The element from second input.out
- The collector used to return zero, one, or more elements.- Throws:
Exception
- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
-
-