datalens-tech / datalens

A modern, scalable analytics system
https://datalens.tech
Apache License 2.0
1.37k stars 59 forks source link

Selector for array fields #202

Open timka-s opened 2 weeks ago

timka-s commented 2 weeks ago

Add the ability to create selectors for arrays (like from function - SPLIT(Tags, ', ')), or fix unnest array filtration) Show unnest([array_field]) in selector values, but filter any([array_field]) in (%selected values%)

Details: If we have string field like Tags

image

We can create selector with Tags

image

Or with UNNEST(SPLIT([Tags], ', '))

image

But, if we choice unnest value, we will receive error - "set-returning functions are not allowed in WHERE" SQL: ... unnest(string_to_array(t4.Tags, ', ')) = 'owner' ...

On the other side, filtration for SPLIT(Tags, ', ') works fine:

image

SQL: ... 'owner' = ANY(string_to_array(t4.Tags, ', ')) ...