aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorDongjoon Hyun <dongjoon@apache.org>2016-12-16 11:30:21 -0800
committerShivaram Venkataraman <shivaram@cs.berkeley.edu>2016-12-16 11:30:21 -0800
commit1169db44bc1d51e68feb6ba2552520b2d660c2c0 (patch)
tree4eb6741d36112277f62ae1961784b0ae1b72fb94 /R
parented84cd068419550b4a1b88a41e73f1870c3967e4 (diff)
downloadspark-1169db44bc1d51e68feb6ba2552520b2d660c2c0.tar.gz
spark-1169db44bc1d51e68feb6ba2552520b2d660c2c0.tar.bz2
spark-1169db44bc1d51e68feb6ba2552520b2d660c2c0.zip
[SPARK-18897][SPARKR] Fix SparkR SQL Test to drop test table
## What changes were proposed in this pull request? SparkR tests, `R/run-tests.sh`, succeeds only once because `test_sparkSQL.R` does not clean up the test table, `people`. As a result, the rows in `people` table are accumulated at every run and the test cases fail. The following is the failure result for the second run. ```r Failed ------------------------------------------------------------------------- 1. Failure: create DataFrame from RDD (test_sparkSQL.R#204) ------------------- collect(sql("SELECT age from people WHERE name = 'Bob'"))$age not equal to c(16). Lengths differ: 2 vs 1 2. Failure: create DataFrame from RDD (test_sparkSQL.R#206) ------------------- collect(sql("SELECT height from people WHERE name ='Bob'"))$height not equal to c(176.5). Lengths differ: 2 vs 1 ``` ## How was this patch tested? Manual. Run `run-tests.sh` twice and check if it passes without failures. Author: Dongjoon Hyun <dongjoon@apache.org> Closes #16310 from dongjoon-hyun/SPARK-18897.
Diffstat (limited to 'R')
-rw-r--r--R/pkg/inst/tests/testthat/test_sparkSQL.R1
1 files changed, 1 insertions, 0 deletions
diff --git a/R/pkg/inst/tests/testthat/test_sparkSQL.R b/R/pkg/inst/tests/testthat/test_sparkSQL.R
index e8ccff8122..2e95737368 100644
--- a/R/pkg/inst/tests/testthat/test_sparkSQL.R
+++ b/R/pkg/inst/tests/testthat/test_sparkSQL.R
@@ -205,6 +205,7 @@ test_that("create DataFrame from RDD", {
c(16))
expect_equal(collect(sql("SELECT height from people WHERE name ='Bob'"))$height,
c(176.5))
+ sql("DROP TABLE people")
unsetHiveContext()
})