BigQuery:从视图查询时出错 [英] BigQuery: Error querying from a view

查看:161
本文介绍了BigQuery:从视图查询时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在查询视图时,我收到此错误:

此查询的视图引用可能不兼容的表的旧版本。请删除并重新创建[myDataset.myTestView]。



我昨天创建了视图,我确信表结构没有改变,即没有新的列,没有列被删除等等。但是,这张桌子实际上每晚都会丢弃并重新创建。这是我的问题的原因?



我应该如何克服这个问题?

视图中表格的内部名称。删除表并重新创建表时,即使外部名称相同,内部名称也会更改。请注意,这是故意的,以便您实际上不会引用错误的表或具有不同模式的表。



如果删除表在视图中引用,您将需要更新视图以指向表。然而,一个空的补丁操作应该就足够了。


I'm receiving this error when querying a view:

A view from this query references an old version of a table that might be incompatible. Please delete and re-create [myDataset.myTestView].

I created the view yesterday, and I'm certain that the table structure has not changed, ie no new columns, no columns were deleted and so on. However, the table was actually dropped and re-created nightly. Is this the cause of my problem?

How should/can I overcome this?

解决方案

BigQuery saves the internal name of your table in the view. When you delete a table and recreate it, the internal name changes, even if the external name is the same. Note that this is deliberate, so that you don't actually refer to the wrong table, or a table that has a different schema.

If you delete a table that is referenced in a view, you will need to update the view to point at the table. An empty patch operation should suffice, however.

这篇关于BigQuery:从视图查询时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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