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#159 from sun-rui/SPARKR-150_2
[SPARKR-150] phase 2: implement takeOrdered() and top().
- Loading branch information
Showing
5 changed files
with
168 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
% Generated by roxygen2 (4.0.2): do not edit by hand | ||
\docType{methods} | ||
\name{takeOrdered} | ||
\alias{takeOrdered} | ||
\alias{takeOrdered,RDD,RDD-method} | ||
\alias{takeOrdered,RDD,integer-method} | ||
\title{Returns the first N elements from an RDD in ascending order.} | ||
\usage{ | ||
takeOrdered(rdd, num) | ||
|
||
\S4method{takeOrdered}{RDD,integer}(rdd, num) | ||
} | ||
\arguments{ | ||
\item{rdd}{An RDD.} | ||
|
||
\item{num}{Number of elements to return.} | ||
} | ||
\value{ | ||
The first N elements from the RDD in ascending order. | ||
} | ||
\description{ | ||
Returns the first N elements from an RDD in ascending order. | ||
} | ||
\examples{ | ||
\dontrun{ | ||
sc <- sparkR.init() | ||
rdd <- parallelize(sc, list(10, 1, 2, 9, 3, 4, 5, 6, 7)) | ||
takeOrdered(rdd, 6L) # list(1, 2, 3, 4, 5, 6) | ||
} | ||
} | ||
|
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,31 @@ | ||
% Generated by roxygen2 (4.0.2): do not edit by hand | ||
\docType{methods} | ||
\name{top} | ||
\alias{top} | ||
\alias{top,RDD,RDD-method} | ||
\alias{top,RDD,integer-method} | ||
\title{Returns the top N elements from an RDD.} | ||
\usage{ | ||
top(rdd, num) | ||
|
||
\S4method{top}{RDD,integer}(rdd, num) | ||
} | ||
\arguments{ | ||
\item{rdd}{An RDD.} | ||
|
||
\item{num}{Number of elements to return.} | ||
} | ||
\value{ | ||
The top N elements from the RDD. | ||
} | ||
\description{ | ||
Returns the top N elements from an RDD. | ||
} | ||
\examples{ | ||
\dontrun{ | ||
sc <- sparkR.init() | ||
rdd <- parallelize(sc, list(10, 1, 2, 9, 3, 4, 5, 6, 7)) | ||
top(rdd, 6L) # list(10, 9, 7, 6, 5, 4) | ||
} | ||
} | ||
|