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#157 from lythesia/master
[SPARKR-161] Support reduceByKeyLocally()
- Loading branch information
Showing
5 changed files
with
175 additions
and
54 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,40 @@ | ||
% Generated by roxygen2 (4.1.0): do not edit by hand | ||
% Please edit documentation in R/RDD.R | ||
\docType{methods} | ||
\name{reduceByKeyLocally} | ||
\alias{reduceByKeyLocally} | ||
\alias{reduceByKeyLocally,RDD,integer-method} | ||
\alias{reduceByKeyLocally,RDD-method} | ||
\title{Merge values by key locally} | ||
\usage{ | ||
reduceByKeyLocally(rdd, combineFunc) | ||
|
||
\S4method{reduceByKeyLocally}{RDD}(rdd, combineFunc) | ||
} | ||
\arguments{ | ||
\item{rdd}{The RDD to reduce by key. Should be an RDD where each element is | ||
list(K, V) or c(K, V).} | ||
|
||
\item{combineFunc}{The associative reduce function to use.} | ||
} | ||
\value{ | ||
A list of elements of type list(K, V') where V' is the merged value for each key | ||
} | ||
\description{ | ||
This function operates on RDDs where every element is of the form list(K, V) or c(K, V). | ||
and merges the values for each key using an associative reduce function, but return the | ||
results immediately to the driver as an R list. | ||
} | ||
\examples{ | ||
\dontrun{ | ||
sc <- sparkR.init() | ||
pairs <- list(list(1, 2), list(1.1, 3), list(1, 4)) | ||
rdd <- parallelize(sc, pairs) | ||
reduced <- reduceByKeyLocally(rdd, "+") | ||
reduced # list(list(1, 6), list(1.1, 3)) | ||
} | ||
} | ||
\seealso{ | ||
reduceByKey | ||
} | ||
|