Skip to content

Commit 62becc1

Browse files
committed
SPARK-7435: Update to DataFrame
1 parent e3677c9 commit 62becc1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

R/pkg/R/DataFrame.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,46 +147,46 @@ setMethod("isLocal",
147147
callJMethod(x@sdf, "isLocal")
148148
})
149149

150-
#' ShowDF
150+
#' show
151151
#'
152152
#' Print the first numRows rows of a DataFrame
153153
#'
154154
#' @param x A SparkSQL DataFrame
155155
#' @param numRows The number of rows to print. Defaults to 20.
156156
#'
157-
#' @rdname showDF
157+
#' @rdname show
158158
#' @export
159159
#' @examples
160160
#'\dontrun{
161161
#' sc <- sparkR.init()
162162
#' sqlCtx <- sparkRSQL.init(sc)
163163
#' path <- "path/to/file.json"
164164
#' df <- jsonFile(sqlCtx, path)
165-
#' showDF(df)
165+
#' show(df)
166166
#'}
167-
setMethod("showDF",
167+
setMethod("show",
168168
signature(x = "DataFrame"),
169169
function(x, numRows = 20) {
170170
callJMethod(x@sdf, "showString", numToInt(numRows))
171171
})
172172

173-
#' show
173+
#' showDF
174174
#'
175175
#' Print the DataFrame column names and types
176176
#'
177177
#' @param x A SparkSQL DataFrame
178178
#'
179-
#' @rdname show
179+
#' @rdname showDF
180180
#' @export
181181
#' @examples
182182
#'\dontrun{
183183
#' sc <- sparkR.init()
184184
#' sqlCtx <- sparkRSQL.init(sc)
185185
#' path <- "path/to/file.json"
186186
#' df <- jsonFile(sqlCtx, path)
187-
#' show(df)
187+
#' showDF
188188
#'}
189-
setMethod("show", "DataFrame",
189+
setMethod("showDF", "DataFrame",
190190
function(object) {
191191
cols <- lapply(dtypes(object), function(l) {
192192
paste(l, collapse = ":")

R/pkg/inst/tests/test_sparkSQL.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,9 @@ test_that("toJSON() returns an RDD of the correct values", {
639639
expect_equal(collect(testRDD)[[1]], mockLines[1])
640640
})
641641

642-
test_that("showDF()", {
642+
test_that("show()", {
643643
df <- jsonFile(sqlCtx, jsonPath)
644-
expect_output(showDF(df), "+----+-------+\n| age| name|\n+----+-------+\n|null|Michael|\n| 30| Andy|\n| 19| Justin|\n+----+-------+\n")
644+
expect_output(show(df), "+----+-------+\n| age| name|\n+----+-------+\n|null|Michael|\n| 30| Andy|\n| 19| Justin|\n+----+-------+\n")
645645
})
646646

647647
test_that("isLocal()", {

0 commit comments

Comments
 (0)