简体   繁体   English

无法在 BigQuery 中创建计划查询,但不确定原因

[英]Unable to create a scheduled query in BigQuery, but not sure why

I'm trying to create an on-demand scheduled query in the BigQuery UI, so that I can connect it to a Pub/Sub topic to run when a data import is complete each day, but I'm unable to create the scheduled query.我正在尝试在 BigQuery UI 中创建按需计划查询,以便我可以将其连接到 Pub/Sub 主题以在每天完成数据导入时运行,但我无法创建计划查询. I get the pop-up requesting permissions, I click allow and the only message I see is "Scheduled Query Error".我收到请求权限的弹出窗口,单击允许,我看到的唯一消息是“计划查询错误”。

I double checked my permissions, I'm the project owner, and the bigquery.admin, and I have all the permissions listed.我仔细检查了我的权限,我是项目所有者和 bigquery.admin,并且列出了所有权限。 I tried using a daily schedule, tried using a table that exists, a table that doesn't exist, tried using a service account, and double checked that I have the transfers enabled, but I always receive the same error message with no details on why it isn't working.我尝试使用每日计划,尝试使用一个存在的表,一个不存在的表,尝试使用服务帐户,并仔细检查我是否启用了传输,但我总是收到相同的错误消息,但没有详细信息为什么它不起作用。

Any ideas on what I'm doing wrong or what I might be able to do to fix it?关于我做错了什么或我可以做些什么来解决它的任何想法?

For some reason you need to create an empty table first with the schema and mention that as table_id.出于某种原因,您需要先使用模式创建一个空表,并将其作为 table_id 提及。 Must be a GCP bug.必须是 GCP 错误。

I had exactly this generic error message 'Scheduled query error', and it was driving me mad.我确实收到了这条通用错误消息“计划查询错误”,这让我抓狂。 I checked all permissions and locations etc. I turns out that the 'Time Travel Window' was set to less than 48 hours for the dataset I was trying to write into.我检查了所有权限和位置等。我发现对于我尝试写入的数据集,“时间旅行窗口”设置为少于 48 小时。 Which apparently BigQuery doesn't like.这显然是 BigQuery 不喜欢的。

To fix this I executed this query为了解决这个问题,我执行了这个查询

ALTER SCHEMA PROJECTNAME.DATASETNAME SET OPTIONS( max_time_travel_hours = 72);改变模式项目名称。数据集名称设置选项(max_time_travel_hours = 72);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM