Skip to content
Snippets Groups Projects
Commit a97d6f3a authored by zero323's avatar zero323 Committed by Shivaram Venkataraman
Browse files

[SPARK-11281][SPARKR] Add tests covering the issue.

The goal of this PR is to add tests covering the issue to ensure that is was resolved by [SPARK-11086](https://issues.apache.org/jira/browse/SPARK-11086).

Author: zero323 <matthew.szymkiewicz@gmail.com>

Closes #9743 from zero323/SPARK-11281-tests.
parent 3a6807fd
No related branches found
No related tags found
No related merge requests found
...@@ -229,7 +229,7 @@ test_that("create DataFrame from list or data.frame", { ...@@ -229,7 +229,7 @@ test_that("create DataFrame from list or data.frame", {
df <- createDataFrame(sqlContext, l, c("a", "b")) df <- createDataFrame(sqlContext, l, c("a", "b"))
expect_equal(columns(df), c("a", "b")) expect_equal(columns(df), c("a", "b"))
l <- list(list(a=1, b=2), list(a=3, b=4)) l <- list(list(a = 1, b = 2), list(a = 3, b = 4))
df <- createDataFrame(sqlContext, l) df <- createDataFrame(sqlContext, l)
expect_equal(columns(df), c("a", "b")) expect_equal(columns(df), c("a", "b"))
...@@ -292,11 +292,15 @@ test_that("create DataFrame with complex types", { ...@@ -292,11 +292,15 @@ test_that("create DataFrame with complex types", {
}) })
test_that("create DataFrame from a data.frame with complex types", { test_that("create DataFrame from a data.frame with complex types", {
ldf <- data.frame(row.names=1:2) ldf <- data.frame(row.names = 1:2)
ldf$a_list <- list(list(1, 2), list(3, 4)) ldf$a_list <- list(list(1, 2), list(3, 4))
ldf$an_envir <- c(as.environment(list(a = 1, b = 2)), as.environment(list(c = 3)))
sdf <- createDataFrame(sqlContext, ldf) sdf <- createDataFrame(sqlContext, ldf)
collected <- collect(sdf)
expect_equivalent(ldf, collect(sdf)) expect_identical(ldf[, 1, FALSE], collected[, 1, FALSE])
expect_equal(ldf$an_envir, collected$an_envir)
}) })
# For test map type and struct type in DataFrame # For test map type and struct type in DataFrame
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment