title: BigQuery - Values referenced in UNNEST must be arrays. UNNEST contains expression of type STRUCT ... at [5:18]
body: <p>Hello guys this time I came across a new error to group array, I will share with you the schema of the table I am consulting so you can tell me the solution. I tried to use ARRAY_TO_STRING but in this case it didn't work out ...</p>
  
  <pre><code>SELECT
      individual_details.gender  AS gender,
      COUNT(DISTINCT profile.owner_id ) AS profile_count_distinct
  FROM dataset.profile  AS profile
  LEFT JOIN UNNEST(profile.individual_details) as individual_details
  GROUP BY 1
  ORDER BY 2 DESC
  </code></pre>
  
  <blockquote>
    <p>Values referenced in UNNEST must be arrays. UNNEST contains expression
    of type STRUCT at [5:18]</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/rbIOQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rbIOQ.png" alt="Schema table"></a></p>