If you need to retain tables that use the previous schema, we recommend creating BigQuery views for those
tables to normalize the data schema. When creating a view to migrate from the previous schema to the new
one, you can use a statement(/bigquery/docs/reference/standard-sql/query-syntax#union) to combine tables
with mismatching schemas. The view you create will depend on the data elds you use in your queries and
dashboards.
One or more of the following examples might apply to your situation, where your queries might or might not use
the new elds and .
1. You use tables that include pre-existing schema properties and new ones, such as ,
, , , and . For an example of how to create
this view, see Creating a view for tables with all elds in the updated schema(#create_view_all_elds).
2. You use tables that do not include the pre-existing schema properties , , and
. For an example of how to create this view, see Creating a view for tables without
, , and (#create_view_without_credits).
3. You use tables that include pre-existing schema properties , , and
but do not include the new schema properties and .
For an example of how to create this view, see Creating a view for tables without and
(#create_view_without_project_and_adjustment).
You can create a view by composing a SQL query that is used to dene the data accessible to the view. For
further details, see Creating a view(/bigquery/docs/views#creating_a_view).
The following are a summary of the steps to create a BigQuery view.
1. Select the query to create the view
2. Run the query and observe the results
3. Save the view
4. Enter the name for the new view
5. Observe the schema of the new view
The following is a query that will create a new view using both the pre-existing and updated schemas. This type
of view limits your exposure to future schema changes.
By using this view for your queries, they will all have the same schema and allow statements to work
successfully. This query preserves the , , , , and
elds and values from the underlying tables.
Standard SQL