if (FALSE) {
library(sparklyr)
sc <- spark_connect(master = "local", version = "3.0.0")
copy_to(
sc,
tibble::tibble(
# x contains 2 arrays each having elements in ascending order
x = list(1:5, 6:10)
)
) %>%
# now each array from x gets sorted in descending order
hof_array_sort(~ as.integer(sign(.y - .x)))
}
Run the code above in your browser using DataLab