Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

BigQuery – How to create scheduled query that writes to new table everyday?

I have a query that I want to run every day, but the results need to be populated to a new table each day due to the amount of data each table will contain (~10B rows/day).

Essentially want to write to a new table like: my_database_name.my_table_name.my_results_{today's_date} each day.

I see the feature that allows creating a "Scheduled Query" but don’t see any option to write to a new table each day.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Is this possible to do in BigQuery? How can I achieve this?

>Solution :

You can use query parameters to achieve this:

my_database_name.my_table_name.my_results_{run_date}

More detail can be found here:
https://cloud.google.com/bigquery/docs/scheduling-queries#available_parameters_2

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading