Hello Dremio Community,
I’ve encountered an issue while executing SQL queries that involve array functions in Dremio Community Edition version 24.3.2. Specifically, when I attempt to execute the following SQL query:
SELECT ARRAY_SIZE(SET_UNION(array_col, ARRAY['item1', 'item2'])) from table_name;
I receive the error message:
Cannot group by an array and aggregate with ARRAY_AGG at the same time.
This issue also occurs when using the ARRAY_INTERSECTION
function in a similar context.
Interestingly, when I use the SET_UNION
function as described in the Dremio documentation (e.g., SELECT SET_UNION(ARRAY[1, 2, 2, 3], ARRAY[1, 3, 5]);
), the query executes successfully and returns the expected result. The issue arises specifically when I specify an array column from my table in the function.
Has anyone else encountered this issue, or does anyone have advice on how to workaround this limitation? Any guidance or recommendations for modifying the query to avoid this error would be greatly appreciated.
Thank you in advance for your help!