v.18.12New Feature
Added arrayEnumerateDense Function
Added the arrayEnumerateDense function. Amos BirdWhy it matters
ThearrayEnumerateDense function provides a way to enumerate elements in an array with dense consecutive numbering, which helps in scenarios where users need to assign sequential indices to array elements without gaps. This enhances array processing capabilities by allowing efficient enumeration within array contexts.How to use it
Use thearrayEnumerateDense function by passing an array as an argument. It returns an array of indices corresponding to the elements, numbered consecutively starting from 1 with no gaps.Example:
SELECT arrayEnumerateDense(['a', 'b', 'c'])This will return an array like
[1, 2, 3].