Skip to content

Commit 92c41c5

Browse files
committed
address comments
1 parent e05e701 commit 92c41c5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

R/pkg/R/functions.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3022,8 +3022,7 @@ setMethod("array_join",
30223022
function(x, delimiter, nullReplacement = NA) {
30233023
jc <- if (is.na(nullReplacement)) {
30243024
callJStatic("org.apache.spark.sql.functions", "array_join", x@jc, delimiter)
3025-
}
3026-
else {
3025+
} else {
30273026
callJStatic("org.apache.spark.sql.functions", "array_join", x@jc, delimiter,
30283027
nullReplacement)
30293028
}

R/pkg/tests/fulltests/test_sparkSQL.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,11 @@ test_that("column functions", {
15271527
expect_equal(result, "Hello#Beautiful#World!")
15281528
result <- collect(select(df2, array_join(df2[[1]], "#")))[[1]]
15291529
expect_equal(result, "Hello#World!")
1530+
df3 <- createDataFrame(list(list(list("Hello", NULL, "World!"))))
1531+
result <- collect(select(df3, array_join(df3[[1]], "#", "Beautiful")))[[1]]
1532+
expect_equal(result, "Hello#Beautiful#World!")
1533+
result <- collect(select(df3, array_join(df3[[1]], "#")))[[1]]
1534+
expect_equal(result, "Hello#World!")
15301535

15311536
# Test array_sort() and sort_array()
15321537
df <- createDataFrame(list(list(list(2L, 1L, 3L, NA)), list(list(NA, 6L, 5L, NA, 4L))))

0 commit comments

Comments
 (0)