@@ -86,6 +86,9 @@ test_that("insertInto() on a registered table", {
86
86
expect_true(count(sql(sqlCtx , " select * from table1" )) == 2 )
87
87
expect_true(first(sql(sqlCtx , " select * from table1" ))$ name == " Bob" )
88
88
dropTempTable(sqlCtx , " table1" )
89
+ unlink(parquetPath )
90
+ unlink(jsonPath2 )
91
+ unlink(parquetPath2 )
89
92
})
90
93
91
94
test_that(" table() returns a new DataFrame" , {
@@ -272,6 +275,7 @@ test_that("distinct() on DataFrames", {
272
275
uniques <- distinct(df )
273
276
expect_true(inherits(uniques , " DataFrame" ))
274
277
expect_true(count(uniques ) == 3 )
278
+ unlink(jsonPathWithDup )
275
279
})
276
280
277
281
test_that(" sampleDF on a DataFrame" , {
@@ -326,6 +330,7 @@ test_that("save() as parquet file", {
326
330
df2 <- loadDF(sqlCtx , parquetPath , " parquet" )
327
331
expect_true(inherits(df2 , " DataFrame" ))
328
332
expect_true(count(df2 ) == 3 )
333
+ unlink(parquetPath )
329
334
})
330
335
331
336
test_that(" test HiveContext" , {
@@ -346,6 +351,7 @@ test_that("test HiveContext", {
346
351
df3 <- sql(hiveCtx , " select * from json" )
347
352
expect_true(inherits(df3 , " DataFrame" ))
348
353
expect_true(count(df3 ) == 6 )
354
+ unlink(jsonPath2 )
349
355
})
350
356
351
357
test_that(" column operators" , {
@@ -443,6 +449,7 @@ test_that("join() on a DataFrame", {
443
449
expect_equal(names(joined4 ), c(" newAge" , " name" , " test" ))
444
450
expect_true(count(joined4 ) == 4 )
445
451
expect_true(first(joined4 )$ newAge == 24 )
452
+ unlink(jsonPath2 )
446
453
})
447
454
448
455
test_that(" toJSON() returns an RDD of the correct values" , {
@@ -487,6 +494,7 @@ test_that("unionAll(), subtract(), and intersect() on a DataFrame", {
487
494
expect_true(inherits(unioned , " DataFrame" ))
488
495
expect_true(count(intersected ) == 1 )
489
496
expect_true(first(intersected )$ name == " Andy" )
497
+ unlink(jsonPath2 )
490
498
})
491
499
492
500
test_that(" withColumn() and withColumnRenamed()" , {
0 commit comments