title: BigQuery unnest to new columns instead of new rows
body: <p>I have a BigQuery table with nested and repeated columns that I'm having trouble unnesting to columns instead of rows.</p>
  <p>This is what it the table looks like:</p>
  <pre><code>  {
      &quot;dateTime&quot;: &quot;Tue Mar 01 2022 11:11:11 GMT-0800 (Pacific Standard Time)&quot;,
      &quot;Field1&quot;: &quot;123456&quot;,
      &quot;Field2&quot;: true,
      &quot;Matches&quot;: [
        {
          &quot;ID&quot;: &quot;abc123&quot;,
          &quot;FieldA&quot;: &quot;asdfljadsf&quot;,
          &quot;FieldB&quot;: &quot;0.99&quot;
        },
        {
          &quot;ID&quot;: &quot;def456&quot;,
          &quot;FieldA&quot;: &quot;sdgfhgdkghj&quot;,
          &quot;FieldB&quot;: &quot;0.92&quot;
        },
        {
          &quot;ID&quot;: &quot;ghi789&quot;,
          &quot;FieldA&quot;: &quot;tfgjyrtjy&quot;,
          &quot;FieldB&quot;: &quot;0.64&quot;
        }
      ]
    },
  </code></pre>
  <p>What I want is to return a table with each one of the nested fields as an individual column so I have a clean dataframe to work with:</p>
  <pre><code>  {
      &quot;dateTime&quot;: &quot;Tue Mar 01 2022 11:11:11 GMT-0800 (Pacific Standard Time)&quot;,
      &quot;Field1&quot;: &quot;123456&quot;,
      &quot;Field2&quot;: true,
      &quot;Matches_1_ID&quot;: &quot;abc123&quot;,
      &quot;Matches_1_FieldA&quot;: &quot;asdfljadsf&quot;,
      &quot;Matches_1_FieldB&quot;: &quot;0.99&quot;, 
      &quot;Matches_2_ID&quot;: &quot;def456&quot;,
      &quot;Matches_2_FieldA&quot;: &quot;sdgfhgdkghj&quot;,
      &quot;Matches_2_FieldB&quot;: &quot;0.92&quot;,
      &quot;Matches_3_ID&quot;: &quot;ghi789&quot;,
      &quot;Matches_3_FieldA&quot;: &quot;tfgjyrtjy&quot;,
      &quot;Matches_3_FieldB&quot;: &quot;0.64&quot;
    },
  </code></pre>
  <p>I tried using UNNEST as below, however it creates new rows with only one set of additional columns, so not what I'm looking for.</p>
  <pre><code>SELECT * 
  FROM table,
  UNNEST(Matches) as items
  
  </code></pre>
  <p>Any solution for this? Thank you in advance.</p>