title: How to insert Billing Data from one Table into another Table in BigQuery
body: <p>I have two tables both billing data from GCP in two different regions. I want to insert one table into the other. Both tables are partitioned by day, and the larger one is being written to by GCP for billing exports, which is why I want to insert the data into the larger table.</p>
  
  <p>I am attempting the following:</p>
  
  <ol>
  <li>Export the smaller table to Google Cloud Storage (GCS) so it can be imported into the other region.</li>
  <li>Import the table from GCS into Big Query.</li>
  <li>Use Big Query SQL to run <code>INSERT INTO dataset.big_billing_table SELECT * FROM dataset.small_billing_table</code></li>
  </ol>
  
  <p>However, I am getting a lot of issues as it won't just let me insert (as there are repeated fields in the schema etc). An example of the dataset can be found here <a href="https://bigquery.cloud.google.com/table/data-analytics-pocs:public.gcp_billing_export_v1_EXAMPL_E0XD3A_DB33F1" rel="nofollow noreferrer">https://bigquery.cloud.google.com/table/data-analytics-pocs:public.gcp_billing_export_v1_EXAMPL_E0XD3A_DB33F1</a> </p>
  
  <p>Thanks :)</p>
  
  <hr>
  
  <p>## Update ##</p>
  
  <p>So the issue was exporting and importing the data with the Avro format and using the auto-detect schema when importing the table back in (Timestamps were getting confused with integer types).</p>
  
  <h3>Solution</h3>
  
  <p>Export the small table in JSON format to GCS, use GCS to do the regional transfer of the files and then import the JSON file into a Bigquery table and <strong>DONT</strong> use schema auto detect (e.g specify the schema manually). Then you can use INSERT INTO no problems etc. </p>