aboutsummaryrefslogtreecommitdiff
path: root/R/pkg/inst/tests/test_sparkSQL.R
diff options
context:
space:
mode:
authorSun Rui <rui.sun@intel.com>2015-11-29 11:08:26 -0800
committerShivaram Venkataraman <shivaram@cs.berkeley.edu>2015-11-29 11:08:26 -0800
commitcc7a1bc9370b163f51230e5ca4be612d133a5086 (patch)
treec4220282a67132df0b93f843b9d4ce327a18e134 /R/pkg/inst/tests/test_sparkSQL.R
parentc793d2d9a1ccc203fc103eb0636958fe8d71f471 (diff)
downloadspark-cc7a1bc9370b163f51230e5ca4be612d133a5086.tar.gz
spark-cc7a1bc9370b163f51230e5ca4be612d133a5086.tar.bz2
spark-cc7a1bc9370b163f51230e5ca4be612d133a5086.zip
[SPARK-11781][SPARKR] SparkR has problem in inferring type of raw type.
Author: Sun Rui <rui.sun@intel.com> Closes #9769 from sun-rui/SPARK-11781.
Diffstat (limited to 'R/pkg/inst/tests/test_sparkSQL.R')
-rw-r--r--R/pkg/inst/tests/test_sparkSQL.R6
1 files changed, 6 insertions, 0 deletions
diff --git a/R/pkg/inst/tests/test_sparkSQL.R b/R/pkg/inst/tests/test_sparkSQL.R
index d3b2f20bf8..92ec82096c 100644
--- a/R/pkg/inst/tests/test_sparkSQL.R
+++ b/R/pkg/inst/tests/test_sparkSQL.R
@@ -72,6 +72,8 @@ test_that("infer types and check types", {
expect_equal(infer_type(e), "map<string,integer>")
expect_error(checkType("map<integer,integer>"), "Key type in a map must be string or character")
+
+ expect_equal(infer_type(as.raw(c(1, 2, 3))), "binary")
})
test_that("structType and structField", {
@@ -250,6 +252,10 @@ test_that("create DataFrame from list or data.frame", {
mtcarsdf <- createDataFrame(sqlContext, mtcars)
expect_equivalent(collect(mtcarsdf), mtcars)
+
+ bytes <- as.raw(c(1, 2, 3))
+ df <- createDataFrame(sqlContext, list(list(bytes)))
+ expect_equal(collect(df)[[1]][[1]], bytes)
})
test_that("create DataFrame with different data types", {