diff options
author | Davies Liu <davies@databricks.com> | 2015-04-10 15:35:45 -0700 |
---|---|---|
committer | Shivaram Venkataraman <shivaram@cs.berkeley.edu> | 2015-04-10 15:35:45 -0700 |
commit | 68ecdb7f99ae30f7c04c33a47ab7f59a3836f2a4 (patch) | |
tree | 727cd553aaecdc703c1ba541c73cf6a2399ee0b4 | |
parent | 4740d6a158cb4d35408a95265c5b950b9e9628a3 (diff) | |
download | spark-68ecdb7f99ae30f7c04c33a47ab7f59a3836f2a4.tar.gz spark-68ecdb7f99ae30f7c04c33a47ab7f59a3836f2a4.tar.bz2 spark-68ecdb7f99ae30f7c04c33a47ab7f59a3836f2a4.zip |
[SPARK-6850] [SparkR] use one partition when we need to compare the whole result
Author: Davies Liu <davies@databricks.com>
Closes #5460 from davies/r_test and squashes the following commits:
0a593ce [Davies Liu] use one partition when we need to compare the whole result
-rw-r--r-- | R/pkg/inst/tests/test_binaryFile.R | 4 | ||||
-rw-r--r-- | R/pkg/inst/tests/test_textFile.R | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/R/pkg/inst/tests/test_binaryFile.R b/R/pkg/inst/tests/test_binaryFile.R index 4bb5f58d83..ca4218f381 100644 --- a/R/pkg/inst/tests/test_binaryFile.R +++ b/R/pkg/inst/tests/test_binaryFile.R @@ -27,7 +27,7 @@ test_that("saveAsObjectFile()/objectFile() following textFile() works", { fileName2 <- tempfile(pattern="spark-test", fileext=".tmp") writeLines(mockFile, fileName1) - rdd <- textFile(sc, fileName1) + rdd <- textFile(sc, fileName1, 1) saveAsObjectFile(rdd, fileName2) rdd <- objectFile(sc, fileName2) expect_equal(collect(rdd), as.list(mockFile)) @@ -40,7 +40,7 @@ test_that("saveAsObjectFile()/objectFile() works on a parallelized list", { fileName <- tempfile(pattern="spark-test", fileext=".tmp") l <- list(1, 2, 3) - rdd <- parallelize(sc, l) + rdd <- parallelize(sc, l, 1) saveAsObjectFile(rdd, fileName) rdd <- objectFile(sc, fileName) expect_equal(collect(rdd), l) diff --git a/R/pkg/inst/tests/test_textFile.R b/R/pkg/inst/tests/test_textFile.R index 7bb3e80031..6b87b4b3e0 100644 --- a/R/pkg/inst/tests/test_textFile.R +++ b/R/pkg/inst/tests/test_textFile.R @@ -81,7 +81,7 @@ test_that("textFile() followed by a saveAsTextFile() returns the same content", fileName2 <- tempfile(pattern="spark-test", fileext=".tmp") writeLines(mockFile, fileName1) - rdd <- textFile(sc, fileName1) + rdd <- textFile(sc, fileName1, 1L) saveAsTextFile(rdd, fileName2) rdd <- textFile(sc, fileName2) expect_equal(collect(rdd), as.list(mockFile)) @@ -93,7 +93,7 @@ test_that("textFile() followed by a saveAsTextFile() returns the same content", test_that("saveAsTextFile() on a parallelized list works as expected", { fileName <- tempfile(pattern="spark-test", fileext=".tmp") l <- list(1, 2, 3) - rdd <- parallelize(sc, l) + rdd <- parallelize(sc, l, 1L) saveAsTextFile(rdd, fileName) rdd <- textFile(sc, fileName) expect_equal(collect(rdd), lapply(l, function(x) {toString(x)})) |