2
votes

I'm using AWS Glue to crawl XML files and add them to a Glue database table. The DynamicFrame I'm using identifies several choices in the XML schema. I can resolve most of them, but there's one case that I can't figure out.

The relevant part of the XML structure is:

<root>
  <order>
     <lineitems>
       <lineitem>
          ...
       </lineitem>
     </lineitems>
  </order>
</root> 

The DynamicFrame shows lineitems as a struct and lineitems/lineitem as a choice between array or struct, I suspect because some orders have one lineitem, whereas other orders have multiple lineitems. I've tried calling resolveChoice with project:array, but that results in element:unknown so I can no longer see the structure of the lineitem. I'm not sure what else to try here, any ideas?