查询失败错误:无法通过前缀查询视图.匹配视图的部分列表是 [英] Query Failed Error: Views cannot be queried through prefix. Partial list of the matched views are

查看:164
本文介绍了查询失败错误:无法通过前缀查询视图.匹配视图的部分列表是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试查询具有多个表和等效视图的数据集.我正在尝试使用_table_suffix查询表,但返回错误查询失败错误:无法通过前缀查询视图.匹配视图的部分列表-......" 我无法从数据集中删除视图.有没有办法只查询表而忽略视图?

I am trying to query a dataset with multiple tables and equivalent views. I am trying to query just the tables using _table_suffix, but it returns an error "Query Failed Error: Views cannot be queried through prefix. Partial list of the matched views-......" I cannot remove the views from the dataset. Is there a way to query the tables only and ignore the views?

SELECT COUNT(*), _table_suffix, DATE(created)
FROM `dataset.viewed_*`
WHERE _table_suffix like '%_page'

推荐答案

您的选择是:

  • 使用不同的名称重新创建视图,以使viewed_前缀与它们不匹配.
  • 匹配表名时,请使用比viewed_长的前缀(如果可能),以便不包括视图名.
  • 将表迁移到单个分区表,这样您就不必不需要使用通配符.
  • Recreate the views under different names, so that the viewed_ prefix doesn't match them.
  • Use a longer prefix than viewed_ (if possible) when matching the table names, so that the view names aren't included.
  • Migrate your tables to a single partitioned table so that you don't need to use a wildcard.

如果可能的话,我建议第三个选择.使用分区表比尝试维护具有共同模式的多个表要好得多.

I would suggest the third option if at all possible; using a partitioned table is much better than trying to maintain multiple tables with a common schema.

这篇关于查询失败错误:无法通过前缀查询视图.匹配视图的部分列表是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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