Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add another test case.
  • Loading branch information
viirya committed Jul 9, 2015
commit 6f9159dac8126cb1b714f9d37ed59aa932d5fad8
10 changes: 10 additions & 0 deletions R/pkg/inst/tests/test_sparkSQL.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ test_that("create DataFrame from RDD", {
expect_equal(count(df), 3)
expect_equal(columns(df), c("name", "age", "height"))
expect_equal(dtypes(df), list(c("name", "string"), c("age", "double"), c("height", "double")))

hiveCtx <- tryCatch({
newJObject("org.apache.spark.sql.hive.test.TestHiveContext", ssc)
}, error = function(err) {
skip("Hive is not build with SparkSQL, skipped")
})
sql(hiveCtx, "CREATE TABLE people (name string, age double, height float) row format delimited fields terminated by ','")
insertInto(df, "people")
expect_equal(sql(hiveCtx, "SELECT age from people"), c(19, 23, 18))
expect_equal(sql(hiveCtx, "SELECT height from people"), c(164.10, 181.4, 173.7))
})

test_that("convert NAs to null type in DataFrames", {
Expand Down