title: BigQuery union schema based on field location and not name
body: <p>Is there a way to run a BigQuery union query and have the schema depend on field name and not field location. The result for the following query isn't intuitive, where the fields are transposed since their order is different in the underlying tables.</p>
  
  <pre><code>with table1 as (
    select 
      '1' as field_1,
      '2' as field_2
  ),
  
  table2 as (
    select 
      '2' as field_2,
      '1' as field_1
  )
  
  
  select * from table1
  union all 
  select * from table2
  </code></pre>
  
  <p>Query Result<br>
  <a href="https://i.stack.imgur.com/8AwPl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8AwPl.png" alt="enter image description here"></a></p>