How to empty a table in BigQuery
by bernt & torsten
BigQuery is the Google Cloud Platform data warehouse solution, and setting up datasets you have many options for importing data into a BigQuery table. There are times when you just want to empty a table, to import data again.
In my use cases, I often create custom data pipelines with Google Cloud Functions this link takes you to the article How to build a RESTful API data pipeline with a Firebase Cloud Function and BigQuery
In BigQuery you can use the BigQuery Data Manipulation Language (DML) enables you to update, insert, and delete data from your BigQuery tables – https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax
Empty a table
To empty a table you could use the delete data you may not be able to delete everything you have to repeat your delete SQL statement. There is another way you could empty all data in your table, that by doing the following.
CREATE OR REPLACE TABLE `ships.noonreport.noonreport`
AS SELECT * FROM `ships.noonreport.noonreport` LIMIT 0;
If you look at the SQL statement you are basically recreating the table without any data in it. This has worked very well for me, have a go with it.
Why It’s Important to Exercise When You’re Over 60
Many of us find ourselves in a pickle as the years pile up. Once reliable sidekicks, our...
A Poem: The Last Time
You never know when it will be,
The last time you ski down slopes of snow,
A Poem: Time Millionaire
When the morning wakes, still and clear,
No more alarms, no more rush....