Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/21294#discussion_r189063233
--- Diff: R/pkg/tests/fulltests/test_sparkSQL.R ---
@@ -1497,10 +1496,16 @@ test_that("column functions", {
result <- collect(select(df, element_at(df[[1]], 1L)))[[1]]
expect_equal(result, c(1, 6))
+ # Test array_sort() and sort_array()
+ df <- createDataFrame(list(list(list(2L, 1L, 3L, NA)), list(list(NA, 6L,
5L, NA, 4L))))
+
+ 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 <- collect(select(df, sort_array(df[[1]], FALSE)))[[1]]
- expect_equal(result, list(list(3L, 2L, 1L), list(6L, 5L, 4L)))
+ expect_equal(result, list(list(3L, 2L, 1L, NA), list(6L, 5L, 4L, NA,
NA)))
result <- collect(select(df, sort_array(df[[1]])))[[1]]
- expect_equal(result, list(list(1L, 2L, 3L), list(4L, 5L, 6L)))
+ expect_equal(result, list(list(NA, 1L, 2L, 3L), list(NA, NA, 4L, 5L,
6L)))
--- End diff --
```
Failed
-------------------------------------------------------------------------
1. Failure: column functions (@test_sparkSQL.R#1502)
---------------------------
`result` not equal to list(list(1L, 2L, 3L, NA), list(4L, 5L, 6L, NA, NA)).
Component 1: Component 4: Modes: numeric, logical
Component 1: Component 4: target is numeric, current is logical
Component 2: Component 4: Modes: numeric, logical
Component 2: Component 4: target is numeric, current is logical
Component 2: Component 5: Modes: numeric, logical
Component 2: Component 5: target is numeric, current is logical
2. Failure: column functions (@test_sparkSQL.R#1505)
---------------------------
`result` not equal to list(list(3L, 2L, 1L, NA), list(6L, 5L, 4L, NA, NA)).
Component 1: Component 4: Modes: numeric, logical
Component 1: Component 4: target is numeric, current is logical
Component 2: Component 4: Modes: numeric, logical
Component 2: Component 4: target is numeric, current is logical
Component 2: Component 5: Modes: numeric, logical
Component 2: Component 5: target is numeric, current is logical
3. Failure: column functions (@test_sparkSQL.R#1507)
---------------------------
`result` not equal to list(list(NA, 1L, 2L, 3L), list(NA, NA, 4L, 5L, 6L)).
Component 1: Component 1: Modes: numeric, logical
Component 1: Component 1: target is numeric, current is logical
Component 2: Component 1: Modes: numeric, logical
Component 2: Component 1: target is numeric, current is logical
Component 2: Component 2: Modes: numeric, logical
Component 2: Component 2: target is numeric, current is logical
```
In my laptop, I hit this issue. How to make the type compatible? cc
@HyukjinKwon @felixcheung
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]