title: Invalid cast argument when querying JSON object in an array in AWS Athena
body: <p>I have a very large json file that consists of a single json object in an array that I'm trying to query via AWS Athena.</p>
  <pre><code>[  {&quot;reporting_entity_name&quot;: &quot;Aetna Life Insurance Company&quot;, 
      &quot;reporting_entity_type&quot;: &quot;Third Party Administrator&quot;,
      &quot;last_updated_on&quot;:&quot;2022-09-05&quot;,
      &quot;providers&quot;: [...],
      &quot;in-network&quot;: [...]} ]
  </code></pre>
  <p>Here's the table definition I created in Athena</p>
  <pre><code>CREATE EXTERNAL TABLE IF NOT EXISTS aetna.adobe_temp_5 (
  plan string
  )
  LOCATION 's3://insurance-transparency-data/'
  TBLPROPERTIES ('has_encrypted_data' = 'false');
  </code></pre>
  <p>I tried using adapting the query suggested in the answer to this <a href="https://stackoverflow.com/questions/61969182/extract-json-in-array-in-aws-athena">question</a> and got the following error</p>
  <pre><code>SELECT plan, e FROM adobe_temp_5 CROSS JOIN UNNEST(CAST(json_parse(plan) AS array(json))) t(e)
  
  INVALID_CAST_ARGUMENT: Cannot cast to array(json). Expected a json array, but got { {&quot;reporting_entity_name&quot;: &quot;Aetna Life Insurance Company&quot;, &quot;reporting_entity_type&quot;: &quot;Third Party Administrator&quot;...
  </code></pre>
  <p>I'm new to presto and ultimately want to be able to query the data that is nested in this JSON object, but I am having a terrible time just accessing the object to query the basics.</p>