Share via


Funzione shuffle

Si applica a:check marked yes Databricks SQL check marked yes Databricks Runtime

Restituisce una permutazione casuale della matrice in expr.

Sintassi

shuffle(expr)

Argomenti

  • expr: espressione ARRAY .

Resi

Il tipo di risultato corrisponde al tipo expr.

Questa funzione non è deterministica.

Esempi

> SELECT shuffle(array(1, 20, 3, 5));
 [3,1,5,20]
> SELECT shuffle(array(1, 20, NULL, 3));
 [20,NULL,3,1]