Skip to content

bigfunctions > get_view_history

get_view_history

Call or Deploy get_view_history ?

✅ You can call this get_view_history bigfunction directly from your Google Cloud Project (no install required).

  • This get_view_history function is deployed in bigfunctions GCP project in 39 datasets for all of the 39 BigQuery regions. You need to use the dataset in the same region as your datasets (otherwise you may have a function not found error).
  • Function is public, so it can be called by anyone. Just copy / paste examples below in your BigQuery console. It just works!
  • You may prefer to deploy the BigFunction in your own project if you want to build and manage your own catalog of functions. This is particularly useful if you want to create private functions (for example calling your internal APIs). Discover the framework

Public BigFunctions Datasets:

Region Dataset
eu bigfunctions.eu
us bigfunctions.us
europe-west1 bigfunctions.europe_west1
asia-east1 bigfunctions.asia_east1
... ...

Description

Signature

get_view_history(fully_qualified_view)

Description

Get BigQuery View history

Examples

call bigfunctions.eu.get_view_history(your_project.your_dataset.view_name);
call bigfunctions.us.get_view_history(your_project.your_dataset.view_name);
call bigfunctions.europe_west1.get_view_history(your_project.your_dataset.view_name);
Need help using get_view_history?

The community can help! Engage the conversation on Slack

For professional suppport, don't hesitate to chat with us.

Found a bug using get_view_history?

If the function does not work as expected, please

  • report a bug so that it can be improved.
  • or open the discussion with the community on Slack.

For professional suppport, don't hesitate to chat with us.

Use cases

A use case for the get_view_history function is tracking changes and debugging issues with a view's definition.

Imagine a complex view used in several dashboards and reports. Suddenly, the reports start showing unexpected results. Using get_view_history, you can quickly:

  1. Identify when the view definition changed: Retrieve the historical definitions of the view to pinpoint the exact time a modification was made that might have introduced the error.
  2. Compare different versions: Analyze the differences between previous versions and the current definition to understand exactly what changed in the SQL query. This helps in identifying the root cause of the issue.
  3. Revert to a previous version: If a problematic change is identified, having access to the historical definitions makes it easy to revert the view to a known good state while a fix is being developed.
  4. Audit view changes: Track who made changes and when, enhancing accountability and control over critical data assets. This is particularly important for regulatory compliance and data governance.
  5. Understand the evolution of a view: By examining the history, you can gain insights into how the view's logic has evolved over time, aiding in documentation and knowledge transfer.

Example: Let's say your view my_project.my_dataset.important_sales_view is producing incorrect totals. You suspect a recent change to the view's SQL is responsible. You could use get_view_history (assuming your project is in the US multi-region):

SELECT * FROM bigfunctions.us.get_view_history('my_project.my_dataset.important_sales_view');

This would return a table showing the different versions of the view's definition along with timestamps, allowing you to compare the SQL before and after the problem started occurring. This helps isolate the problematic change and restore a correct version quickly.

Spread the word

BigFunctions is fully open-source. Help make it a success by spreading the word!

Share on Add a on