I accidentally deleted a scheduled query In Big Query.
I can't anyway a way to retrieve it, is it possible ?
It’s not possible to directly restore a deleted scheduled query in BigQuery, however you can still retrieve the SQL of a specific run of that scheduled query. Here's how:
bq --format=prettyjson show -j <job_id>
Replace <job_id>
with the job ID you noted earlier. This command will display the details of that specific job run, including the SQL query.
For example, the output might look like:
{
"jobReference": {
"jobId": "scheduled_query_75adfjida2-9654-5884-4547-001affadf56",
"projectId": "my-project-id",
"location": "US"
},
"configuration": {
"query": "SELECT * FROM my_table"
},
...
}
Once you have the SQL query, you can manually recreate the scheduled query. You'll need: