v.23.2New Feature
Introduce arrayShuffle Function for Random Array Permutations
Introduce arrayShuffle function for random array permutations. #45271 (Joanna Hulboj).
Why it matters
ThearrayShuffle function provides a way to randomly permute the elements of an array, enabling users to create randomized orderings of array data within ClickHouse queries. This is useful for sampling, randomized algorithms, or any scenario where randomized array order is required.How to use it
Use thearrayShuffle function by passing an array as an argument in your query. For example:SELECT arrayShuffle([1, 2, 3, 4, 5]) AS shuffled_arrayThis will return the input array in a random order each time it is called.