Skip to content

Commit 0db23a4

Browse files
author
Andrew Or
committed
Merge branch 'master' of github.com:apache/spark into dag-viz-sql
2 parents 1e211db + 4b3bb0e commit 0db23a4

File tree

163 files changed

+12116
-2293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+12116
-2293
lines changed

.rat-excludes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,12 @@ logs
7474
.*scalastyle-output.xml
7575
.*dependency-reduced-pom.xml
7676
known_translations
77+
json_expectation
78+
local-1422981759269/*
79+
local-1422981780767/*
80+
local-1425081759269/*
81+
local-1426533911241/*
82+
local-1426633911242/*
83+
local-1430917381534/*
7784
DESCRIPTION
7885
NAMESPACE

R/pkg/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Suggests:
1515
Description: R frontend for Spark
1616
License: Apache License (== 2.0)
1717
Collate:
18+
'schema.R'
1819
'generics.R'
1920
'jobj.R'
2021
'RDD.R'
2122
'pairRDD.R'
22-
'schema.R'
2323
'column.R'
2424
'group.R'
2525
'DataFrame.R'

R/pkg/NAMESPACE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ exportMethods("cache",
2626
"intersect",
2727
"isLocal",
2828
"join",
29-
"length",
3029
"limit",
3130
"orderBy",
3231
"names",
@@ -101,9 +100,6 @@ export("cacheTable",
101100
"tables",
102101
"uncacheTable")
103102

104-
export("sparkRSQL.init",
105-
"sparkRHive.init")
106-
107103
export("structField",
108104
"structField.jobj",
109105
"structField.character",

R/pkg/R/DataFrame.R

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ setMethod("initialize", "DataFrame", function(.Object, sdf, isCached) {
4545

4646
#' @rdname DataFrame
4747
#' @export
48+
#'
49+
#' @param sdf A Java object reference to the backing Scala DataFrame
50+
#' @param isCached TRUE if the dataFrame is cached
4851
dataFrame <- function(sdf, isCached = FALSE) {
4952
new("DataFrame", sdf, isCached)
5053
}
@@ -244,7 +247,7 @@ setMethod("columns",
244247
})
245248

246249
#' @rdname columns
247-
#' @export
250+
#' @aliases names,DataFrame,function-method
248251
setMethod("names",
249252
signature(x = "DataFrame"),
250253
function(x) {
@@ -399,23 +402,23 @@ setMethod("repartition",
399402
dataFrame(sdf)
400403
})
401404

402-
#' toJSON
403-
#'
404-
#' Convert the rows of a DataFrame into JSON objects and return an RDD where
405-
#' each element contains a JSON string.
406-
#'
407-
#' @param x A SparkSQL DataFrame
408-
#' @return A StringRRDD of JSON objects
409-
#' @rdname tojson
410-
#' @export
411-
#' @examples
412-
#'\dontrun{
413-
#' sc <- sparkR.init()
414-
#' sqlCtx <- sparkRSQL.init(sc)
415-
#' path <- "path/to/file.json"
416-
#' df <- jsonFile(sqlCtx, path)
417-
#' newRDD <- toJSON(df)
418-
#'}
405+
# toJSON
406+
#
407+
# Convert the rows of a DataFrame into JSON objects and return an RDD where
408+
# each element contains a JSON string.
409+
#
410+
#@param x A SparkSQL DataFrame
411+
# @return A StringRRDD of JSON objects
412+
# @rdname tojson
413+
# @export
414+
# @examples
415+
#\dontrun{
416+
# sc <- sparkR.init()
417+
# sqlCtx <- sparkRSQL.init(sc)
418+
# path <- "path/to/file.json"
419+
# df <- jsonFile(sqlCtx, path)
420+
# newRDD <- toJSON(df)
421+
#}
419422
setMethod("toJSON",
420423
signature(x = "DataFrame"),
421424
function(x) {
@@ -578,8 +581,8 @@ setMethod("limit",
578581
dataFrame(res)
579582
})
580583

581-
# Take the first NUM rows of a DataFrame and return a the results as a data.frame
582-
584+
#' Take the first NUM rows of a DataFrame and return a the results as a data.frame
585+
#'
583586
#' @rdname take
584587
#' @export
585588
#' @examples
@@ -644,22 +647,22 @@ setMethod("first",
644647
take(x, 1)
645648
})
646649

647-
#' toRDD()
648-
#'
649-
#' Converts a Spark DataFrame to an RDD while preserving column names.
650-
#'
651-
#' @param x A Spark DataFrame
652-
#'
653-
#' @rdname DataFrame
654-
#' @export
655-
#' @examples
656-
#'\dontrun{
657-
#' sc <- sparkR.init()
658-
#' sqlCtx <- sparkRSQL.init(sc)
659-
#' path <- "path/to/file.json"
660-
#' df <- jsonFile(sqlCtx, path)
661-
#' rdd <- toRDD(df)
662-
#' }
650+
# toRDD()
651+
#
652+
# Converts a Spark DataFrame to an RDD while preserving column names.
653+
#
654+
# @param x A Spark DataFrame
655+
#
656+
# @rdname DataFrame
657+
# @export
658+
# @examples
659+
#\dontrun{
660+
# sc <- sparkR.init()
661+
# sqlCtx <- sparkRSQL.init(sc)
662+
# path <- "path/to/file.json"
663+
# df <- jsonFile(sqlCtx, path)
664+
# rdd <- toRDD(df)
665+
# }
663666
setMethod("toRDD",
664667
signature(x = "DataFrame"),
665668
function(x) {
@@ -706,6 +709,7 @@ setMethod("groupBy",
706709
#'
707710
#' Compute aggregates by specifying a list of columns
708711
#'
712+
#' @param x a DataFrame
709713
#' @rdname DataFrame
710714
#' @export
711715
setMethod("agg",
@@ -721,53 +725,53 @@ setMethod("agg",
721725
# the requested map function. #
722726
###################################################################################
723727

724-
#' @rdname lapply
728+
# @rdname lapply
725729
setMethod("lapply",
726730
signature(X = "DataFrame", FUN = "function"),
727731
function(X, FUN) {
728732
rdd <- toRDD(X)
729733
lapply(rdd, FUN)
730734
})
731735

732-
#' @rdname lapply
736+
# @rdname lapply
733737
setMethod("map",
734738
signature(X = "DataFrame", FUN = "function"),
735739
function(X, FUN) {
736740
lapply(X, FUN)
737741
})
738742

739-
#' @rdname flatMap
743+
# @rdname flatMap
740744
setMethod("flatMap",
741745
signature(X = "DataFrame", FUN = "function"),
742746
function(X, FUN) {
743747
rdd <- toRDD(X)
744748
flatMap(rdd, FUN)
745749
})
746750

747-
#' @rdname lapplyPartition
751+
# @rdname lapplyPartition
748752
setMethod("lapplyPartition",
749753
signature(X = "DataFrame", FUN = "function"),
750754
function(X, FUN) {
751755
rdd <- toRDD(X)
752756
lapplyPartition(rdd, FUN)
753757
})
754758

755-
#' @rdname lapplyPartition
759+
# @rdname lapplyPartition
756760
setMethod("mapPartitions",
757761
signature(X = "DataFrame", FUN = "function"),
758762
function(X, FUN) {
759763
lapplyPartition(X, FUN)
760764
})
761765

762-
#' @rdname foreach
766+
# @rdname foreach
763767
setMethod("foreach",
764768
signature(x = "DataFrame", func = "function"),
765769
function(x, func) {
766770
rdd <- toRDD(x)
767771
foreach(rdd, func)
768772
})
769773

770-
#' @rdname foreach
774+
# @rdname foreach
771775
setMethod("foreachPartition",
772776
signature(x = "DataFrame", func = "function"),
773777
function(x, func) {
@@ -788,6 +792,7 @@ setMethod("$", signature(x = "DataFrame"),
788792
getColumn(x, name)
789793
})
790794

795+
#' @rdname select
791796
setMethod("$<-", signature(x = "DataFrame"),
792797
function(x, name, value) {
793798
stopifnot(class(value) == "Column" || is.null(value))
@@ -1009,7 +1014,7 @@ setMethod("sortDF",
10091014
})
10101015

10111016
#' @rdname sortDF
1012-
#' @export
1017+
#' @aliases orderBy,DataFrame,function-method
10131018
setMethod("orderBy",
10141019
signature(x = "DataFrame", col = "characterOrColumn"),
10151020
function(x, col) {
@@ -1046,7 +1051,7 @@ setMethod("filter",
10461051
})
10471052

10481053
#' @rdname filter
1049-
#' @export
1054+
#' @aliases where,DataFrame,function-method
10501055
setMethod("where",
10511056
signature(x = "DataFrame", condition = "characterOrColumn"),
10521057
function(x, condition) {

0 commit comments

Comments
 (0)