forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request apache#112 from sun-rui/outer_join
Add leftOuterJoin() and rightOuterJoin() to the RDD class.
- Loading branch information
Showing
6 changed files
with
301 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
% Generated by roxygen2 (4.0.2): do not edit by hand | ||
\docType{methods} | ||
\name{leftOuterJoin} | ||
\alias{leftOuterJoin} | ||
\alias{leftOuterJoin,RDD,RDD,integer-method} | ||
\alias{leftOuterJoin,RDD,RDD-method} | ||
\title{Left outer join two RDDs} | ||
\usage{ | ||
leftOuterJoin(rdd1, rdd2, numPartitions) | ||
|
||
\S4method{leftOuterJoin}{RDD,RDD,integer}(rdd1, rdd2, numPartitions) | ||
} | ||
\arguments{ | ||
\item{rdd1}{An RDD to be joined. Should be an RDD where each element is | ||
list(K, V).} | ||
|
||
\item{rdd2}{An RDD to be joined. Should be an RDD where each element is | ||
list(K, V).} | ||
|
||
\item{numPartitions}{Number of partitions to create.} | ||
} | ||
\value{ | ||
For each element (k, v) in rdd1, the resulting RDD will either contain | ||
all pairs (k, (v, w)) for (k, w) in rdd2, or the pair (k, (v, NULL)) | ||
if no elements in rdd2 have key k. | ||
} | ||
\description{ | ||
This function left-outer-joins two RDDs where every element is of the form list(K, V). | ||
The key types of the two RDDs should be the same. | ||
} | ||
\examples{ | ||
\dontrun{ | ||
sc <- sparkR.init() | ||
rdd1 <- parallelize(sc, list(list(1, 1), list(2, 4))) | ||
rdd2 <- parallelize(sc, list(list(1, 2), list(1, 3))) | ||
leftOuterJoin(rdd1, rdd2, 2L) # list(list(1, list(1, 2)), list(1, list(1, 3)), list(2, list(4, NULL))) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
% Generated by roxygen2 (4.0.2): do not edit by hand | ||
\docType{methods} | ||
\name{rightOuterJoin} | ||
\alias{rightOuterJoin} | ||
\alias{rightOuterJoin,RDD,RDD,integer-method} | ||
\alias{rightOuterJoin,RDD,RDD-method} | ||
\title{Right outer join two RDDs} | ||
\usage{ | ||
rightOuterJoin(rdd1, rdd2, numPartitions) | ||
|
||
\S4method{rightOuterJoin}{RDD,RDD,integer}(rdd1, rdd2, numPartitions) | ||
} | ||
\arguments{ | ||
\item{rdd1}{An RDD to be joined. Should be an RDD where each element is | ||
list(K, V).} | ||
|
||
\item{rdd2}{An RDD to be joined. Should be an RDD where each element is | ||
list(K, V).} | ||
|
||
\item{numPartitions}{Number of partitions to create.} | ||
} | ||
\value{ | ||
For each element (k, w) in rdd2, the resulting RDD will either contain | ||
all pairs (k, (v, w)) for (k, v) in rdd1, or the pair (k, (NULL, w)) | ||
if no elements in rdd1 have key k. | ||
} | ||
\description{ | ||
This function right-outer-joins two RDDs where every element is of the form list(K, V). | ||
The key types of the two RDDs should be the same. | ||
} | ||
\examples{ | ||
\dontrun{ | ||
sc <- sparkR.init() | ||
rdd1 <- parallelize(sc, list(list(1, 2), list(1, 3))) | ||
rdd2 <- parallelize(sc, list(list(1, 1), list(2, 4))) | ||
rightOuterJoin(rdd1, rdd2, 2L) # list(list(1, list(2, 1)), list(1, list(3, 1)), list(2, list(NULL, 4))) | ||
} | ||
} | ||
|