在BigQuery中,如果每个查询都创建一个临时表,是否可以在随后的SQL语句中找到该临时表的名称? [英] In BigQuery if every query creates a temporary table, is it possible to find out the name of that temporary table in a subsequent SQL statement?

查看:200
本文介绍了在BigQuery中,如果每个查询都创建一个临时表,是否可以在随后的SQL语句中找到该临时表的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果每个查询都创建一个临时表,是否可以在随后的SQL语句中找到该临时表的名称?



Per https://cloud.google.com/bigquery/querying-data


所有查询结果都保存到一个表格中,该表格可以是持久性的
或临时性的: b
$ b

临时表是保存在特殊
数据集中的随机命名表;桌子的使用寿命约为24小时。临时的
表格不可用于共享,并且使用任何
标准列表或其他表格操作方法都不可见。


例如:

  / *查询1 * / 
select * from whatever;

/ *查询2 * /
select * from [temporary_table_that_just_got_created];


解决方案

您无法使用BigQuery Web UI中的名称BigQuery SQL

但是,您可以通过查看历史记录查找
您应该在历史记录列表中查找并通过点击查找来扩展它

您正在查找的名称位于目的地表之下



也可以使用BigQuery API执行此操作,并且在客户端应用程序中非常有用。



您应该使用作业:获取API a>并查看configuration.query.destinationTable( https://cloud.google .com / bigquery / docs / reference / v2 / jobs#resource

If every query creates a temporary table, is it possible to find out the name of that temporary table in a subsequent SQL statement?

Per https://cloud.google.com/bigquery/querying-data :

All query results are saved to a table, which can be either persistent or temporary:

A temporary table is a randomly named table saved in a special dataset; The table has a lifetime of approximately 24 hours. Temporary tables are not available for sharing, and are not visible using any of the standard list or other table manipulation methods.

For example:

/* query 1 */
select * from whatever;

/* query 2 */
select * from [temporary_table_that_just_got_created];

解决方案

You cannot determine that name from within BigQuery Web UI using BigQuery SQL
But, Yes, you can find it by looking in Query History
You should find you query in history list and expand it by clicking on it
Name you are looking for is under "Destination Table"

It is also possible to do this with BigQuery API and very useful in client applications

You should use Jobs: get API and see configuration.query.destinationTable (https://cloud.google.com/bigquery/docs/reference/v2/jobs#resource)

这篇关于在BigQuery中,如果每个查询都创建一个临时表,是否可以在随后的SQL语句中找到该临时表的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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