Flatten a LIST of objects

Hi,

I’m trying to flatten a list of objects and getting into this issue. I’ve searched in the community and online but couldn’t find anything similar.

The column type has a A # type, regards the brackets and attempting to cast it to LIST getting a “Unknown datatype name ‘LIST’” error.
Please advice.

Thank you

Flatten will work on Json Arrays. https://docs.dremio.com/sql-reference/sql-functions/nested-data.html.
Please share how the actual data in the column you are applying Flatten to looks like.

Note you may also be able to use the UNEST transformation as shown on https://docs.dremio.com/working-with-datasets/data-curation.html

Hi. I also have a similar issue. I’ve created a dataset and one columns I customize the records to represents a list os values (ex.: [“value1”, “value2”, “value3”]), however the datatype created by Dremio is VARCHAR but I would like that column would be a LIST to make me able to use the function “FLATTEN”.
I’ve tried many ways to solve this issue with no success. Are there some way to cast a VARCHAR column to LIST or another methods to make that?

2 Likes