Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/21362#discussion_r191986143
--- Diff: R/pkg/tests/fulltests/test_sparkSQL.R ---
@@ -1504,15 +1504,16 @@ test_that("column functions", {
expect_equal(result, "cba")
# Test array_sort() and sort_array()
- df <- createDataFrame(list(list(list(2L, 1L, 3L, NA)), list(list(NA, 6L,
5L, NA, 4L))))
+ df <- createDataFrame(list(list(list(2L, 1L, 3L, NA)), list(list(NA, 5L,
NA, 4L))))
+ as_integer_lists <- function(x) lapply(x, lapply, as.integer)
- result <- collect(select(df, array_sort(df[[1]])))[[1]]
- expect_equal(result, list(list(1L, 2L, 3L, NA), list(4L, 5L, 6L, NA,
NA)))
+ result <- as_integer_lists(collect(select(df, array_sort(df[[1]])))[[1]])
--- End diff --
`as_integer_lists` doesn't seem like the right approach - that just
basically changes everything returned into integer (even though it might not be
returned that way from JVM)
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]