bigquery 数据集名称以数字和 TABLE_DATE_RANGE 开头 [英] bigquery dataset name starting with a number and TABLE_DATE_RANGE

查看:38
本文介绍了bigquery 数据集名称以数字和 TABLE_DATE_RANGE 开头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 bigquery 与一个名为87891428"的数据集结合使用,该数据集包含每日表格.由于函数 TABLE_DATE_RANGE,我尝试查询日期范围:

I'm using bigquery with a dataset called '87891428' containing daily tables. I try to query a dates range thanks to the function TABLE_DATE_RANGE:

SELECT avg(foo) 
FROM (
      TABLE_DATE_RANGE(87891428.a_abc_, 
                       TIMESTAMP('2014-09-30'),
                       TIMESTAMP('2014-10-19'))
     )

但这会导致一个非常明确的错误信息:

But this leads to a very explicit error message:

错误:在第 3 行,第 21 列遇到".期待以下之一:

当我将几个表复制到名为test"的新数据集时,我感觉 TABLE_DATE_RANGE 不喜欢以数字开头的数据集,查询运行正常.是否有人遇到过这个问题,如果那么最好的解决方法是什么(据我所知你不能重命名数据集)?

I've the feeling that TABLE_DATE_RANGE doesn"t like to have a dataset starting with a number cause when I copy few tables into a new dataset called 'test' the query run properly. Does anyone has already encountered this issue and if so what is the best workaround (as far as I know you can't rename a dataset) ?

推荐答案

解决方法是在数据集名称和表前缀周围使用括号:

The fix for this is to use brackets around the dataset name and table prefix:

SELECT avg(foo) 
FROM (
      TABLE_DATE_RANGE([87891428.a_abc_], 
                       TIMESTAMP('2014-09-30'),
                       TIMESTAMP('2014-10-19'))
     )

这篇关于bigquery 数据集名称以数字和 TABLE_DATE_RANGE 开头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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