[GitHub] spark pull request #21362: [SPARK-24197][SparkR][FOLLOWUP] Fixing failing te...

2018-07-16 Thread mn-mikke
Github user mn-mikke closed the pull request at:

https://github.com/apache/spark/pull/21362


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #21362: [SPARK-24197][SparkR][FOLLOWUP] Fixing failing te...

2018-05-30 Thread HyukjinKwon
Github user HyukjinKwon commented on a diff in the pull request:

https://github.com/apache/spark/pull/21362#discussion_r191994811
  
--- 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 --

+1


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #21362: [SPARK-24197][SparkR][FOLLOWUP] Fixing failing te...

2018-05-30 Thread felixcheung
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: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #21362: [SPARK-24197][SparkR][FOLLOWUP] Fixing failing te...

2018-05-18 Thread mn-mikke
GitHub user mn-mikke opened a pull request:

https://github.com/apache/spark/pull/21362

[SPARK-24197][SparkR][FOLLOWUP] Fixing failing tests for array_sort and 
sort_array

## What changes were proposed in this pull request?

The PR tries to fix [the 
problem](https://github.com/apache/spark/pull/21294#discussion_r189063233) with 
failing tests for the SparkR functions `array_sort` and `sort_array`.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/mn-mikke/spark SPARK-24197-followup

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/21362.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #21362


commit 0e46f6ba2e84df4863fc0958deaf67fea9713d5b
Author: Marek Novotny 
Date:   2018-05-18T11:22:47Z

[SPARK-24197][SparkR][FOLLOWUP] Fixing failing tests for array_sort and 
sort_array




---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org