You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've merged support for table functions within the select list (#7716). This will be available in 3.2. Together with unnest this can be used for your example:
create table t (someArr array(string));
insert into t (someArr) values (['a', 'b']);
insert into t (someArr) values (['b', 'c']);
select distinct * from (select unnest(someArr) from t) tt;
+-----------------+
| unnest(somearr) |
+-----------------+
| a |
| b |
| c |
+-----------------+
Note that it will be necessary to use a subquery for the unnest and do the aggregation/grouping on-top.
Use case: Getting the unique values of an array for an entire table
Feature description: Being able to run a
SELECT DISTINCT
statement against an array column.Schema:
Example data:
SQL Statement:
Currently throws:
Cannot GROUP BY 'someArr': invalid data type 'string_array'
Would like for it to return something like:
The text was updated successfully, but these errors were encountered: