-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update scheduled query #590
Comments
I assume you also want to be able to create a new scheduled query, not just update an existing? |
Yes, that would be very helpful. In our process, we often set them up manually in BigQuery and then update them automatically in R/Python scripts thereafter. But, if it were easy to create and update them from bigrquery, this would be much cleaner. |
Note to self: look at discovery doc wrappers in googlesheets4. |
Do you have any sense of how you get a data source setup so I could test it myself? |
@hadley Yes, I think I can help with that... I'm not sure what detail you need. Happy to chat if you need more info..
CREATE OR REPLACE TABLE `your_project_name.your_dataset_name.baby_names` AS
SELECT *
FROM `bigquery-public-data.usa_names.usa_1910_2013`
LIMIT 1000; This example has the following schema: fullname type Here is some info about the dataset itself: https://console.cloud.google.com/marketplace/product/social-security-administration/us-names?project=long-base-314819 Hope this helps! Let me know if you need anything else. |
How does that connect with a schedule query? |
I need a bit more help to get this to a place where I can test it, so I'm going to put off until the next release of bigrquery which I'll aim to do early next year. |
Ok! Sorry I missed your previous question. Thanks for the update. I'm happy to help with your testing when you are ready to resume. |
Our team would love to be able to use bigrquery to update a scheduled query in BigQuery. Specifically, I would like to be able to update the "query" itself with updated SQL code, but updating the scheduling would also be useful. I generate queries using R scripts and set them to run on BigQuery using Python.. or if I'm desperate I'll copy and paste them manually.
The documentation for the required API endpoint is here: https://cloud.google.com/bigquery/docs/reference/datatransfer/rest/v1/projects.locations.transferConfigs/patch
Google provides an example for updating a query's "display_name" using the Python client library here https://cloud.google.com/bigquery/docs/scheduling-queries#updating-a-scheduled-query
I modified it below to update the query string itself:
I have long wished that we could do this in directly in R using bigrquery.
The text was updated successfully, but these errors were encountered: