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#102 from hlin09/hlin09
Adds function flatMapValues.
- Loading branch information
Showing
4 changed files
with
83 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ exportMethods( | |
"Filter", | ||
"filter", | ||
"flatMap", | ||
"flatMapValues", | ||
"groupByKey", | ||
"keys", | ||
"length", | ||
|
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,32 @@ | ||
% Generated by roxygen2 (4.0.2): do not edit by hand | ||
\docType{methods} | ||
\name{flatMapValues} | ||
\alias{flatMapValues} | ||
\alias{flatMapValues,RDD,function-method} | ||
\title{Pass each value in the key-value pair RDD through a flatMap function without | ||
changing the keys; this also retains the original RDD's partitioning.} | ||
\usage{ | ||
flatMapValues(X, FUN) | ||
\S4method{flatMapValues}{RDD,`function`}(X, FUN) | ||
} | ||
\arguments{ | ||
\item{X}{The RDD to apply the transformation.} | ||
\item{FUN}{the transformation to apply on the value of each element.} | ||
} | ||
\value{ | ||
a new RDD created by the transformation. | ||
} | ||
\description{ | ||
The same as 'flatMapValues()' in Spark. | ||
} | ||
\examples{ | ||
\dontrun{ | ||
sc <- sparkR.init() | ||
rdd <- parallelize(sc, list(list(1, c(1,2)), list(2, c(3,4)))) | ||
collect(flatMapValues(rdd, function(x) { x })) | ||
Output: list(list(1,1), list(1,2), list(2,3), list(2,4)) | ||
} | ||
} | ||