diff options
author | felixcheung <felixcheung_m@hotmail.com> | 2016-01-19 18:31:03 -0800 |
---|---|---|
committer | Shivaram Venkataraman <shivaram@cs.berkeley.edu> | 2016-01-19 18:31:03 -0800 |
commit | 488bbb216c82306e82b8963a331d48d484e8eadd (patch) | |
tree | b8124d51a1806e68b8038b20481221b7fe1765ec /R/pkg/inst/tests/testthat/test_sparkSQL.R | |
parent | beda9014220be77dd735e6af1903e7d93dceb110 (diff) | |
download | spark-488bbb216c82306e82b8963a331d48d484e8eadd.tar.gz spark-488bbb216c82306e82b8963a331d48d484e8eadd.tar.bz2 spark-488bbb216c82306e82b8963a331d48d484e8eadd.zip |
[SPARK-12232][SPARKR] New R API for read.table to avoid name conflict
shivaram sorry it took longer to fix some conflicts, this is the change to add an alias for `table`
Author: felixcheung <felixcheung_m@hotmail.com>
Closes #10406 from felixcheung/readtable.
Diffstat (limited to 'R/pkg/inst/tests/testthat/test_sparkSQL.R')
-rw-r--r-- | R/pkg/inst/tests/testthat/test_sparkSQL.R | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/R/pkg/inst/tests/testthat/test_sparkSQL.R b/R/pkg/inst/tests/testthat/test_sparkSQL.R index 6610734cf4..14d40d5066 100644 --- a/R/pkg/inst/tests/testthat/test_sparkSQL.R +++ b/R/pkg/inst/tests/testthat/test_sparkSQL.R @@ -335,7 +335,6 @@ writeLines(mockLinesMapType, mapTypeJsonPath) test_that("Collect DataFrame with complex types", { # ArrayType df <- read.json(sqlContext, complexTypeJsonPath) - ldf <- collect(df) expect_equal(nrow(ldf), 3) expect_equal(ncol(ldf), 3) @@ -490,19 +489,15 @@ test_that("insertInto() on a registered table", { unlink(parquetPath2) }) -test_that("table() returns a new DataFrame", { +test_that("tableToDF() returns a new DataFrame", { df <- read.json(sqlContext, jsonPath) registerTempTable(df, "table1") - tabledf <- table(sqlContext, "table1") + tabledf <- tableToDF(sqlContext, "table1") expect_is(tabledf, "DataFrame") expect_equal(count(tabledf), 3) + tabledf2 <- tableToDF(sqlContext, "table1") + expect_equal(count(tabledf2), 3) dropTempTable(sqlContext, "table1") - - # nolint start - # Test base::table is working - #a <- letters[1:3] - #expect_equal(class(table(a, sample(a))), "table") - # nolint end }) test_that("toRDD() returns an RRDD", { |