aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
author云峤 <chensong.cs@alibaba-inc.com>2015-05-04 12:08:38 -0700
committerReynold Xin <rxin@databricks.com>2015-05-04 12:08:38 -0700
commitf32e69ecc333867fc966f65cd0aeaeddd43e0945 (patch)
tree2dbcc9704acb83d0a7b40f3cee8cc084e29f6dd9 /R
parente0833c5958bbd73ff27cfe6865648d7b6e5a99bc (diff)
downloadspark-f32e69ecc333867fc966f65cd0aeaeddd43e0945.tar.gz
spark-f32e69ecc333867fc966f65cd0aeaeddd43e0945.tar.bz2
spark-f32e69ecc333867fc966f65cd0aeaeddd43e0945.zip
[SPARK-7319][SQL] Improve the output from DataFrame.show()
Author: 云峤 <chensong.cs@alibaba-inc.com> Closes #5865 from kaka1992/df.show and squashes the following commits: c79204b [云峤] Update a1338f6 [云峤] Update python dataFrame show test and add empty df unit test. 734369c [云峤] Update python dataFrame show test and add empty df unit test. 84aec3e [云峤] Update python dataFrame show test and add empty df unit test. 159b3d5 [云峤] update 03ef434 [云峤] update 7394fd5 [云峤] update test show ced487a [云峤] update pep8 b6e690b [云峤] Merge remote-tracking branch 'upstream/master' into df.show 30ac311 [云峤] [SPARK-7294] ADD BETWEEN 7d62368 [云峤] [SPARK-7294] ADD BETWEEN baf839b [云峤] [SPARK-7294] ADD BETWEEN d11d5b9 [云峤] [SPARK-7294] ADD BETWEEN
Diffstat (limited to 'R')
-rw-r--r--R/pkg/R/DataFrame.R2
-rw-r--r--R/pkg/inst/tests/test_sparkSQL.R2
2 files changed, 2 insertions, 2 deletions
diff --git a/R/pkg/R/DataFrame.R b/R/pkg/R/DataFrame.R
index b59b700af5..841e77e55e 100644
--- a/R/pkg/R/DataFrame.R
+++ b/R/pkg/R/DataFrame.R
@@ -167,7 +167,7 @@ setMethod("isLocal",
setMethod("showDF",
signature(x = "DataFrame"),
function(x, numRows = 20) {
- cat(callJMethod(x@sdf, "showString", numToInt(numRows)), "\n")
+ callJMethod(x@sdf, "showString", numToInt(numRows))
})
#' show
diff --git a/R/pkg/inst/tests/test_sparkSQL.R b/R/pkg/inst/tests/test_sparkSQL.R
index af7a6c5820..f82e56fdd8 100644
--- a/R/pkg/inst/tests/test_sparkSQL.R
+++ b/R/pkg/inst/tests/test_sparkSQL.R
@@ -641,7 +641,7 @@ test_that("toJSON() returns an RDD of the correct values", {
test_that("showDF()", {
df <- jsonFile(sqlCtx, jsonPath)
- expect_output(showDF(df), "age name \nnull Michael\n30 Andy \n19 Justin ")
+ expect_output(showDF(df), "+----+-------+\n| age| name|\n+----+-------+\n|null|Michael|\n| 30| Andy|\n| 19| Justin|\n+----+-------+\n")
})
test_that("isLocal()", {