在BigQuery网络用户界面中运行多个查询 [英] Running multiple queries in BigQuery web UI

查看:64
本文介绍了在BigQuery网络用户界面中运行多个查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用BigQuery网络用户界面来运行查询.我想从数据集中的所有表中删除一些特定的行.我想通过一次运行所有删除查询来做到这一点,如下所示:

I am using to BigQuery web UI for running my queries. I want to delete some specific rows from all tables in a Dataset. I want to do it by running all delete queries in one go, like below:

DELETE FROM `dataset_name.tabl_name_1` WHERE REGEXP_CONTAINS(user_dim.user_id, r'g_1478_h_1.') = TRUE;
DELETE FROM `dataset_name.tabl_name_2` WHERE REGEXP_CONTAINS(user_dim.user_id, r'g_1478_h_1.') = TRUE;
DELETE FROM `dataset_name.tabl_name_3` WHERE REGEXP_CONTAINS(user_dim.user_id, r'g_1478_h_1.') = TRUE

几乎有500张桌子.因此,一次将有500个查询要运行.我没有选中使用旧版Sql"的选项.

There are almost 500 tables. So there will be 500 queries to be run in one go. I have unchecked the option of 'use Legacy Sql'.

但是在运行上述查询(近500个)时返回错误:

But on running above queries (almost 500) returns error:

语法错误:[2:1]处的关键字DELETE意外

Syntax error: Unexpected keyword DELETE at [2:1]

我的问题有解决办法吗?

Is there any solution to my problem?

推荐答案

您不能在BigQuery网络用户界面中执行此操作!

You cannot do this in BigQuery web UI!

您此处的最佳选择是使用您偏好的 BigQuery client 并编写那些重复的语句

Your best option here is to use BigQuery client of your preference and script those repetitive statements

对于DML,请记住 quotas/limitation

Have in mind quotas/limitation for DML

编辑(2019年10月):

Edit (October 2019):

支持脚本

Support for scripting and stored procedures is now in beta. You can submit multiple statements separated with semi-colons and BigQuery is able to run them now.

这篇关于在BigQuery网络用户界面中运行多个查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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