用旧表格模式恢复被覆盖的BigQuery表格 [英] Recover overwritten Bigquery table with older table schema

查看:86
本文介绍了用旧表格模式恢复被覆盖的BigQuery表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不小心覆盖了现有的表格,将其用作临时表格以存储另一个选择的结果。如果旧表和新表具有不同的表结构,是否有办法将其回滚?是否有可能阻止某人覆盖特定的表以防止将来再次发生这种情况?



在下面的问题中有一条评论说如果表模式不可能恢复是不同的。不知道最近是否发生了变化。



是否有可能在BigQuery中恢复被覆盖的数据

解决方案

首先覆盖你的再次使用与您的丢失表具有完全相同模式的东西(任何)

然后按照引用后的相同步骤操作 -

  SELECT * FROM [yourproject:yourdataset.yourtable@< time>] 

如果您的表格在上周左右或创建后没有更改,则可以使用@ 0



或者避免成本 - 做bq cp ....


I accidentally overwrote an existing table by using it as a temporary table to store result of another select. Is there a way to roll it back if both the old table and new table has a different table structure? Is it possible to prevent someone from overwriting a particular table to prevent this in future?

There is a comment in following question which says it is not possible to recover if table schema is different. Not sure if that has changed recently.

Is it possible to recover overwritten data in BigQuery

解决方案

first overwrite your table again with something (anything) that has exact same schema as your "lost" table

Then follow same steps as in referenced post - which is :

SELECT * FROM [yourproject:yourdataset.yourtable@<time>]  

You can use @0 if your table was not changed for last week or so or since creation

Or, to avoid cost - do bq cp ....

这篇关于用旧表格模式恢复被覆盖的BigQuery表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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