Resolving schema changes for de-identified views

If you enable view de-identification, then you might need to rescynchronize out-of-sync view schemas.

Identifying out-of-sync schema data

Tonic Structural uses the schema metadata from the INFORMATION_SCHEMAS metadata tables to display a view’s schema and to manage its schema changes.

For performance reasons, Structural assumes this schema metadata is accurate.

However, schema metadata for BigQuery views might be out of sync with the actual results of querying the view. This can occur for various reasons, but is typically because the query definition is written in such a way that changes to referenced tables result in changes to the schema of the query results.

During data generation, jobs ignore and issue a warning for any views that have out-of-date schema metadata.

Before you can de-identify the affected views, you must manually resynchronize the schema metadata in BigQuery.

Resynchronizing logical views

For logical views, schema metadata is not automatically updated during the lifecycle of the view.

If the underlying schema of the logical view has changed, then to trigger a refresh, you must either change or recreate the view definition.

Changing the view query

To trigger a schema refresh, use the BigQuery user interface to modify the view query, then save the view.

No-op changes do trigger schema metadata refreshes.

However, saving the view without modifying the query does not trigger a refresh.

Recreating the view definition

To recreate the view, run the following command:

"CREATE OR REPLACE VIEW '{project}.{dataset}.{view}' OPTIONS({options}) AS ({view_query})"

The full DDL for a view is in the the following table: {dataset}.INFORMATION_SCHEMA.TABLES

Resynchronizing materialized views

For materialized views, refreshes automatically synchronize the schema metadata.

For details on how to configure automatic refreshes and trigger manual refreshes of materialized views, go to the BigQuery documentation.

Last updated