shuffle
function
Applies to: Databricks SQL Databricks Runtime
Returns a random permutation of the array in expr
.
Syntax
shuffle(expr)
Arguments
expr
: AnARRAY
expression.
Returns
The result type matches the type expr
.
This function is non-deterministic.
Examples
> SELECT shuffle(array(1, 20, 3, 5));
[3,1,5,20]
> SELECT shuffle(array(1, 20, NULL, 3));
[20,NULL,3,1]
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for