SparkR (version 2.1.2)

sort_array: sort_array

Description

Sorts the input array in ascending or descending order according to the natural ordering of the array elements.

Usage

sort_array(x, asc = TRUE)

# S4 method for Column sort_array(x, asc = TRUE)

Arguments

x

A Column to sort

asc

A logical flag indicating the sorting order. TRUE, sorting is in ascending order. FALSE, sorting is in descending order.

See Also

Other collection_funcs: array_contains, explode, posexplode, size

Examples

Run this code
# NOT RUN {
sort_array(df$c)
sort_array(df$c, FALSE)
# }

Run the code above in your browser using DataLab