简体   繁体   中英

Can't save query in Schedule Query. "Scheduled Query Error"

I have created a View in BigQuery and want to set it to update. When trying to save a query in a Schedule Query, an error occurs: Scheduled Query Error

在此处输入图像描述

When I run a query, unless I manually specify the data location to run the query, BQ defaults to the US multi-region and uses resources in the US. But then, The BQ Data Transfer Service throws an error since I are now trying to export the data from a query that was executed in US to a table that sits in EU. So, to fix that, before you schedule the query, I have to go under the query detailed settings, and change the Data Location to EU Then save these settings, and finish scheduling the query.

This error is about permissions. You need these permissions to create a query scheduler with BigQuery:

  • bigquery.transfers.update or (bigquery.jobs.create and bigquery.transfers.get )
  • bigquery.jobs.create
  • bigquery.datasets.update

Another option is adding this role roles/bigquery.admin, including all the permissions you need to schedule or modify a query.

You can read more information about permissions .

Before that, make sure you have enable the Billing enter image description here And then maybe because of BigQuery Data Transfer Service (trusted through the pop-up windows……) bother me a lot…… If the pop-up window does not appear, you should check the address bar to make sure the window is not blocked, if it's not the cause,you can try to change the location of data(related to where you store your data),and submit. enter image description here

I had the same problem and it turned out to be the pop-up blocker on my Firefox browser. The pop-up blocker on Chrome also stopped the scheduled query working but Chrome was a bit more visible that pop-ups were blocked.

On Firefox, click on the circled icon in the address bar to see blocked pop-ups

Firefox 地址栏

Change the pop-up permission to 'Allow'.

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. Which apparently BigQuery doesn't like.

To fix this I executed this query

ALTER SCHEMA `PROJECTNAME.DATASETNAME`
  SET OPTIONS(
    max_time_travel_hours = 72);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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