title: How to create AWS Glue DynamicFrame from json with array of objects
body: <p>I have json files in S3 containing array of objects in each file, like shown below.</p>
  <pre><code>[{
      &quot;id&quot;: &quot;c147162a-a304-11ea-aa90-0242ac110028&quot;,
      &quot;clientId&quot;: &quot;xxx&quot;,
      &quot;contextUUID&quot;: &quot;1bb6b39e-b181-4a6d-b43b-4040f9d254b8&quot;,
      &quot;tags&quot;: {},
      &quot;timestamp&quot;: 1592855898
  }, {
      &quot;id&quot;: &quot;c147162a-a304-11ea-aa90-0242ac110028&quot;,
      &quot;clientId&quot;: &quot;yyy&quot;,
      &quot;contextUUID&quot;: &quot;1bb6b39e-b181-4a6d-b43b-4040f9d254b8&quot;,
      &quot;tags&quot;: {},
      &quot;timestamp&quot;: 1592855898
  }]
  </code></pre>
  <p>I used crawler to detect and load the schema to catalog. It was successful and it created a schema with a single column named <code>array</code> with data type <code>array&lt;struct&lt;id:string,clientId:string,contextUUID:string,tags:string,timestamp:int&gt;&gt;</code>.</p>
  <p>Now, I tried to load the data using <code>glueContext.create_dynamic_frame.from_catalog</code> function, but I could not see any data. I tried printing schema and data as shown below.</p>
  <pre><code>ds = glueContext.create_dynamic_frame.from_catalog(
         database = &quot;dbname&quot;,
         table_name = &quot;tablename&quot;)
  
  ds.printSchema()
  root
  ds.schema()
  StructType([], {})
  ds.show()
  empty
  ds.toDF().show()
  ++
  ||
  ++
  ++
  </code></pre>
  <p>Any idea, what I am doing wrong? I am planning to extract each object in array and transform the object to a different schema.</p>