Github user zero323 commented on a diff in the pull request:
https://github.com/apache/spark/pull/9743#discussion_r45074174
--- Diff: R/pkg/inst/tests/test_sparkSQL.R ---
@@ -294,9 +294,21 @@ test_that("create DataFrame with complex types", {
test_that("create DataFrame from a data.frame with complex types", {
ldf <- data.frame(row.names=1:2)
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)
+ collected <- collect(sdf)
+
+ expect_equivalent(ldf[, 1, FALSE], collected[, 1, FALSE])
+
+ asSortedList <- function(e) {
+ tmp <- as.list(e)
+ tmp[sort(names(tmp))]
+ }
- expect_equivalent(ldf, collect(sdf))
+ expect_equal(
--- End diff --
@sun-rui You're right. Both changes should work just fine.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]