list_scheduled_queries¶
list_scheduled_queries(project)
Description¶
Returnsscheduled_queries
of project project
.
Result is a list of TransferConfig.
Usage¶
Call or Deploy list_scheduled_queries
?
Call list_scheduled_queries
directly
The easiest way to use bigfunctions
list_scheduled_queries
function is deployed in 39 public datasets for all of the 39 BigQuery regions.- It can be called by anyone. Just copy / paste examples below in your BigQuery console. It just works!
- (You need to use the dataset in the same region as your datasets otherwise you may have a function not found error)
Public BigFunctions Datasets
Region | Dataset |
---|---|
eu |
bigfunctions.eu |
us |
bigfunctions.us |
europe-west1 |
bigfunctions.europe_west1 |
asia-east1 |
bigfunctions.asia_east1 |
... | ... |
Deploy list_scheduled_queries
in your project
Why deploy?
- You may prefer to deploy
list_scheduled_queries
in your own project 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).
- Get started by reading the framework page
Deployment
list_scheduled_queries
function can be deployed with:
pip install bigfunctions
bigfun get list_scheduled_queries
bigfun deploy list_scheduled_queries
Examples¶
If project
is null, then the current project is used
select bigfunctions.eu.list_scheduled_queries("None")
select bigfunctions.us.list_scheduled_queries("None")
select bigfunctions.europe_west1.list_scheduled_queries("None")
+---------------------------------------------------------------------------------------------------+
| scheduled_queries |
+---------------------------------------------------------------------------------------------------+
| [
"bigquery-public-data.america_health_rankings",
"bigquery-public-data.austin_311",
...
]
|
+---------------------------------------------------------------------------------------------------+
Use cases¶
A use case for the list_scheduled_queries
function would be for an administrator or developer who needs to gain an overview of all scheduled queries within a specific Google Cloud project. Here are some more detailed scenarios:
-
Auditing and Governance: A data governance team could use this function to regularly check for any unauthorized or outdated scheduled queries. They could then disable or modify them as needed, ensuring compliance with data policies.
-
Monitoring and Performance Tuning: By listing all scheduled queries, a performance engineer can identify resource-intensive queries that might be impacting overall BigQuery performance. This allows for optimization efforts and better resource allocation.
-
Documentation and Knowledge Sharing: This function can be used to generate a list of existing scheduled queries for documentation purposes. This is useful for onboarding new team members or understanding the data pipelines within a project.
-
Dependency Management: Before making changes to underlying datasets or tables, a developer could use
list_scheduled_queries
to identify any scheduled queries that depend on those resources. This helps prevent unintended consequences and ensures a smooth transition during updates. -
Troubleshooting and Debugging: When investigating issues with data freshness or unexpected results, knowing which scheduled queries are running and their configurations is crucial. This function provides that information quickly and easily.
-
Building Management Tools: You could integrate this function into a custom management tool or dashboard that provides a centralized view of all scheduled tasks within a project, including queries, data transfers, and other operations.
Example: Imagine a company that uses scheduled queries to generate daily reports. They could use list_scheduled_queries
within a script to:
- Retrieve all scheduled queries.
- Filter the list based on specific criteria (e.g., queries that run on a specific dataset, or queries containing certain keywords).
- Generate alerts if any crucial scheduled queries are missing or disabled.
- Automatically enable or disable queries based on certain conditions.
This allows for programmatic control and monitoring of scheduled queries, simplifying administration and improving reliability.
Need help or Found a bug?
Get help using list_scheduled_queries
The community can help! Engage the conversation on Slack
We also provide professional suppport.
Report a bug about list_scheduled_queries
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.
We also provide professional suppport.