Class Join
java.lang.Object
org.apache.beam.sdk.extensions.joinlibrary.Join
Utility class with different versions of joins. All methods join two collections of key/value
pairs (KV).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
PTransform representing a full outer join of two collections of KV elements.static class
PTransform representing an inner join of two collections of KV elements.static class
PTransform representing a left outer join of two collections of KV elements.static class
PTransform representing a right outer join of two collections of KV elements. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V1, V2>
PCollection<KV<K, KV<V1, V2>>> fullOuterJoin
(String name, PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection, V1 leftNullValue, V2 rightNullValue) Full Outer Join of two collections of KV elements.static <K,
V1, V2>
PCollection<KV<K, KV<V1, V2>>> fullOuterJoin
(PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection, V1 leftNullValue, V2 rightNullValue) Full Outer Join of two collections of KV elements.static <K,
V1, V2>
PCollection<KV<K, KV<V1, V2>>> innerJoin
(String name, PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection) Inner join of two collections of KV elements.static <K,
V1, V2>
PCollection<KV<K, KV<V1, V2>>> innerJoin
(PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection) Inner join of two collections of KV elements.static <K,
V1, V2>
PCollection<KV<K, KV<V1, V2>>> leftOuterJoin
(String name, PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection, V2 nullValue) Left Outer Join of two collections of KV elements.static <K,
V1, V2>
PCollection<KV<K, KV<V1, V2>>> leftOuterJoin
(PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection, V2 nullValue) static <K,
V1, V2>
PCollection<KV<K, KV<V1, V2>>> rightOuterJoin
(String name, PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection, V1 nullValue) Right Outer Join of two collections of KV elements.static <K,
V1, V2>
PCollection<KV<K, KV<V1, V2>>> rightOuterJoin
(PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection, V1 nullValue) Right Outer Join of two collections of KV elements.
-
Constructor Details
-
Join
public Join()
-
-
Method Details
-
innerJoin
public static <K,V1, PCollection<KV<K,V2> KV<V1, innerJoinV2>>> (PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection) Inner join of two collections of KV elements.- Type Parameters:
K
- Type of the key for both collectionsV1
- Type of the values for the left collection.V2
- Type of the values for the right collection.- Parameters:
leftCollection
- Left side collection to join.rightCollection
- Right side collection to join.- Returns:
- A joined collection of KV where Key is the key and value is a KV where Key is of type V1 and Value is type V2.
-
innerJoin
public static <K,V1, PCollection<KV<K,V2> KV<V1, innerJoinV2>>> (String name, PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection) Inner join of two collections of KV elements.- Type Parameters:
K
- Type of the key for both collectionsV1
- Type of the values for the left collection.V2
- Type of the values for the right collection.- Parameters:
name
- Name of the PTransform.leftCollection
- Left side collection to join.rightCollection
- Right side collection to join.- Returns:
- A joined collection of KV where Key is the key and value is a KV where Key is of type V1 and Value is type V2.
-
leftOuterJoin
public static <K,V1, PCollection<KV<K,V2> KV<V1, leftOuterJoinV2>>> (String name, PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection, V2 nullValue) Left Outer Join of two collections of KV elements.- Type Parameters:
K
- Type of the key for both collectionsV1
- Type of the values for the left collection.V2
- Type of the values for the right collection.- Parameters:
name
- Name of the PTransform.leftCollection
- Left side collection to join.rightCollection
- Right side collection to join.nullValue
- Value to use as null value when right side do not match left side.- Returns:
- A joined collection of KV where Key is the key and value is a KV where Key is of type V1 and Value is type V2. Values that should be null or empty is replaced with nullValue.
-
leftOuterJoin
public static <K,V1, PCollection<KV<K,V2> KV<V1, leftOuterJoinV2>>> (PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection, V2 nullValue) -
rightOuterJoin
public static <K,V1, PCollection<KV<K,V2> KV<V1, rightOuterJoinV2>>> (String name, PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection, V1 nullValue) Right Outer Join of two collections of KV elements.- Type Parameters:
K
- Type of the key for both collectionsV1
- Type of the values for the left collection.V2
- Type of the values for the right collection.- Parameters:
name
- Name of the PTransform.leftCollection
- Left side collection to join.rightCollection
- Right side collection to join.nullValue
- Value to use as null value when left side do not match right side.- Returns:
- A joined collection of KV where Key is the key and value is a KV where Key is of type V1 and Value is type V2. Values that should be null or empty is replaced with nullValue.
-
rightOuterJoin
public static <K,V1, PCollection<KV<K,V2> KV<V1, rightOuterJoinV2>>> (PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection, V1 nullValue) Right Outer Join of two collections of KV elements.- Type Parameters:
K
- Type of the key for both collectionsV1
- Type of the values for the left collection.V2
- Type of the values for the right collection.- Parameters:
leftCollection
- Left side collection to join.rightCollection
- Right side collection to join.nullValue
- Value to use as null value when left side do not match right side.- Returns:
- A joined collection of KV where Key is the key and value is a KV where Key is of type V1 and Value is type V2. Values that should be null or empty is replaced with nullValue.
-
fullOuterJoin
public static <K,V1, PCollection<KV<K,V2> KV<V1, fullOuterJoinV2>>> (String name, PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection, V1 leftNullValue, V2 rightNullValue) Full Outer Join of two collections of KV elements.- Type Parameters:
K
- Type of the key for both collectionsV1
- Type of the values for the left collection.V2
- Type of the values for the right collection.- Parameters:
name
- Name of the PTransform.leftCollection
- Left side collection to join.rightCollection
- Right side collection to join.leftNullValue
- Value to use as null value when left side do not match right side.rightNullValue
- Value to use as null value when right side do not match right side.- Returns:
- A joined collection of KV where Key is the key and value is a KV where Key is of type V1 and Value is type V2. Values that should be null or empty is replaced with leftNullValue/rightNullValue.
-
fullOuterJoin
public static <K,V1, PCollection<KV<K,V2> KV<V1, fullOuterJoinV2>>> (PCollection<KV<K, V1>> leftCollection, PCollection<KV<K, V2>> rightCollection, V1 leftNullValue, V2 rightNullValue) Full Outer Join of two collections of KV elements.- Type Parameters:
K
- Type of the key for both collectionsV1
- Type of the values for the left collection.V2
- Type of the values for the right collection.- Parameters:
leftCollection
- Left side collection to join.rightCollection
- Right side collection to join.leftNullValue
- Value to use as null value when left side do not match right side.rightNullValue
- Value to use as null value when right side do not match right side.- Returns:
- A joined collection of KV where Key is the key and value is a KV where Key is of type V1 and Value is type V2. Values that should be null or empty is replaced with leftNullValue/rightNullValue.
-