# Flatten a LIST of objects

**URL:** <https://community.dremio.com/t/flatten-a-list-of-objects/4105>\
**Category:** Dremio University\
**Created:** [September 18, 2019, 5:12pm UTC](https://community.dremio.com/t/flatten-a-list-of-objects/4105 "2019-09-18T17:12:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![acornea](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@acornea](https://community.dremio.com/u/acornea)\
**Post date:** [September 18, 2019, 5:12pm UTC](https://community.dremio.com/t/flatten-a-list-of-objects/4105/1 "2019-09-18T17:12:30Z")

</div>

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.

 ![14%20AM](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/b/bace4bc24ebdec5b470a7c9e6766100f615d3cbe.png)

Thank you

---

<div class="post-metadata">

**Author:** ![deepak](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/deepak/32/1855_2.png) [@deepak](https://community.dremio.com/u/deepak)\
**Post date:** [September 18, 2019, 8:39pm UTC](https://community.dremio.com/t/flatten-a-list-of-objects/4105/2 "2019-09-18T20:39:58Z")

</div>

Flatten will work on Json Arrays. [https://docs.dremio.com/sql-reference/sql-functions/nested-data.html](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](https://docs.dremio.com/working-with-datasets/data-curation.html)

---

<div class="post-metadata">

**Author:** ![aislanrs](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@aislanrs](https://community.dremio.com/u/aislanrs)\
**Post date:** [December 12, 2019, 7:02pm UTC](https://community.dremio.com/t/flatten-a-list-of-objects/4105/3 "2019-12-12T19:02:41Z")

</div>

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?
