Github user shivaram commented on a diff in the pull request:
https://github.com/apache/spark/pull/8984#discussion_r41670925
--- Diff: R/pkg/inst/tests/test_sparkSQL.R ---
@@ -1355,13 +1355,18 @@ test_that("SQL error message is returned from JVM",
{
expect_equal(grepl("Table Not Found: blah", retError), TRUE)
})
+irisDF <- createDataFrame(sqlContext, iris)
+
test_that("Method as.data.frame as a synonym for collect()", {
- irisDF <- createDataFrame(sqlContext, iris)
expect_equal(as.data.frame(irisDF), collect(irisDF))
irisDF2 <- irisDF[irisDF$Species == "setosa", ]
expect_equal(as.data.frame(irisDF2), collect(irisDF2))
})
+test_that("Method coltypes() to get R's data types of a DataFrame", {
+ expect_equal(coltypes(irisDF), c(rep("numeric", 4), "character"))
+})
--- End diff --
Could you add a test with some other types ? Also another one which runs
into the `NA` case and uses the SQL type would be useful.
---
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]