This project has retired. For details please refer to its Attic page.
Cartesian (Apache Crunch 0.11.0 API)

org.apache.crunch.lib
Class Cartesian

java.lang.Object
  extended by org.apache.crunch.lib.Cartesian

public class Cartesian
extends Object

Utilities for Cartesian products of two PTable or PCollection instances.


Constructor Summary
Cartesian()
           
 
Method Summary
static
<U,V> PCollection<Pair<U,V>>
cross(PCollection<U> left, PCollection<V> right)
          Performs a full cross join on the specified PCollections (using the same strategy as Pig's CROSS operator).
static
<U,V> PCollection<Pair<U,V>>
cross(PCollection<U> left, PCollection<V> right, int parallelism)
          Performs a full cross join on the specified PCollections (using the same strategy as Pig's CROSS operator).
static
<K1,K2,U,V>
PTable<Pair<K1,K2>,Pair<U,V>>
cross(PTable<K1,U> left, PTable<K2,V> right)
          Performs a full cross join on the specified PTables (using the same strategy as Pig's CROSS operator).
static
<K1,K2,U,V>
PTable<Pair<K1,K2>,Pair<U,V>>
cross(PTable<K1,U> left, PTable<K2,V> right, int parallelism)
          Performs a full cross join on the specified PTables (using the same strategy as Pig's CROSS operator).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cartesian

public Cartesian()
Method Detail

cross

public static <K1,K2,U,V> PTable<Pair<K1,K2>,Pair<U,V>> cross(PTable<K1,U> left,
                                                              PTable<K2,V> right)
Performs a full cross join on the specified PTables (using the same strategy as Pig's CROSS operator).

Type Parameters:
K1 - Type of left PTable's keys.
K2 - Type of right PTable's keys.
U - Type of the first PTable's values
V - Type of the second PTable's values
Parameters:
left - A PTable to perform a cross join on.
right - A PTable to perform a cross join on.
Returns:
The joined result as tuples of ((K1,K2), (U,V)).
See Also:
Cross Join

cross

public static <K1,K2,U,V> PTable<Pair<K1,K2>,Pair<U,V>> cross(PTable<K1,U> left,
                                                              PTable<K2,V> right,
                                                              int parallelism)
Performs a full cross join on the specified PTables (using the same strategy as Pig's CROSS operator).

Type Parameters:
K1 - Type of left PTable's keys.
K2 - Type of right PTable's keys.
U - Type of the first PTable's values
V - Type of the second PTable's values
Parameters:
left - A PTable to perform a cross join on.
right - A PTable to perform a cross join on.
parallelism - The square root of the number of reducers to use. Increasing parallelism also increases copied data.
Returns:
The joined result as tuples of ((K1,K2), (U,V)).
See Also:
Cross Join

cross

public static <U,V> PCollection<Pair<U,V>> cross(PCollection<U> left,
                                                 PCollection<V> right)
Performs a full cross join on the specified PCollections (using the same strategy as Pig's CROSS operator).

Type Parameters:
U - Type of the first PCollection's values
V - Type of the second PCollection's values
Parameters:
left - A PCollection to perform a cross join on.
right - A PCollection to perform a cross join on.
Returns:
The joined result as tuples of (U,V).
See Also:
Cross Join

cross

public static <U,V> PCollection<Pair<U,V>> cross(PCollection<U> left,
                                                 PCollection<V> right,
                                                 int parallelism)
Performs a full cross join on the specified PCollections (using the same strategy as Pig's CROSS operator).

Type Parameters:
U - Type of the first PCollection's values
V - Type of the second PCollection's values
Parameters:
left - A PCollection to perform a cross join on.
right - A PCollection to perform a cross join on.
Returns:
The joined result as tuples of (U,V).
See Also:
Cross Join


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.