在BigQuery中计划查询 [英] Schedule query in BigQuery

查看:107
本文介绍了在BigQuery中计划查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个BigQuery查询结合了两个表格(每日Google Analytics导出)。我想要的是将查询保存为视图或表格,但随着新的Google Analytics数据加载到BigQuery中,每天都会自动更新最终的视图/表格。



感谢您的帮助

解决方案

BigQuery本身不会提供任何调度机制。



您可以使用第三方解决方案或使用您选择的客户开发自己的产品

https://cloud.google.com/bigquery/docs/reference/libraries



<例如,您可以使用App Engine Cron Service自动执行BigQuery查询
https://cloud.google.com/appengine/docs/java/config/cron
https://cloud.google.com/appengine/features/#cron
https://cloud.google.com/bigquery/bigquery-api-quickstart



或者,您可以使用Google Apps脚本来使用基于Time的触发器编写BigQuery查询,以执行该脚本

https://developers.google.com/apps-script/advanced/bigquery
https://developers.google.com/apps-script/guides/triggers/installable#time-driven_triggers

此外,请查看最近推出的Google云端函数(Beta)

https://cloud.google.com/functions/docs/


I have a BigQuery query which unions two tables (daily Google Analytics exports). What I want is to save the query as a view or table but have that final view/table update automatically everyday as the new Google Analytics data is loaded into BigQuery.

Thanks for your help

解决方案

BigQuery by itself doesn’t provide any scheduling mechanism.

You can use 3rd party solution or develop your own using client of your choice
https://cloud.google.com/bigquery/docs/reference/libraries

For example,

You can use App Engine Cron Service to automate BigQuery query execution https://cloud.google.com/appengine/docs/java/config/cron https://cloud.google.com/appengine/features/#cron https://cloud.google.com/bigquery/bigquery-api-quickstart

Or, you can use Google Apps Script to script BigQuery query with a Time based trigger to execute that script
https://developers.google.com/apps-script/advanced/bigquery https://developers.google.com/apps-script/guides/triggers/installable#time-driven_triggers

Also, check recently introduced Google Cloud Functions (Beta)
https://cloud.google.com/functions/docs/

这篇关于在BigQuery中计划查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆