title: Is there a way to flatten a struct field in AWS Athena?
body: <p>I'm trying to write an Athena query which will allow me to expand a struct inside of a select statement.</p>
  
  <p>Lets say I have a table my_table which looks like:</p>
  
  <pre><code>id string,
  metadata struct&lt;field1:varchar,field2:int&gt;
  </code></pre>
  
  <p>I know that by placing the name <code>field1</code> in the query I can pull the field from the struct, but I would like something more general such as <code>metadata.*</code> so schema can be abstract.</p>
  
  <p>This can easily be done with Python and some libraries but wanted to check if there isn't anything that can be done inside Athena.</p>
  
  <p>Thanks!</p>