Google BigQuery 删除行? [英] Google BigQuery Delete Rows?

查看:22
本文介绍了Google BigQuery 删除行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道任何计划添加对从 Google Bigquery 的表中删除部分数据的支持?我们现在面临的问题是我们正在使用它来分析我们随时间收集的数据点.我们希望在过去 X 天的数据上运行查询,但是在最后 X 天的数据之后,我们不再需要将数据存储在 BigQuery 中.

Anyone know of any plans to add support for delete parts of data from a table in Google Bigquery? The issue we have right now is we are using it for analytics of data points we collect over time. We want to run the queries over the last X days of data, however after the last X days of data we no longer need to store the data in BigQuery.

目前我们能想到的唯一删除数据的方法是删除整个数据表,然后重新创建它并加载 X 天数的数据.不过,这也需要我们将数据存储在每日 CSV 文件中,这不是最佳选择.

The only way currently we can think of to delete the data would be to delete the entire table of data, then recreate it and load it with X number of days of data. This would though require us to store our data in daily CSV files too, which isn't optimal.

关于如何处理此问题或是否有删除行查询在不久的将来出现的任何建议?

Any recommendations on how to handle this issue or if there is a delete rows query coming in the near future?

推荐答案

2016 更新:BigQuery 现在可以删除和更新行 -- Fh

2016 update: BigQuery can delete and update rows now -- Fh

https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax

感谢您描述您的用例.BigQuery 在设计上是仅附加的.我们目前不支持从现有数据集中删除单行或一批行.

Thanks for describing your use case. BigQuery is append-only by design. We currently don't support deleting single rows or a batch of rows from an existing dataset.

目前,要实现旋转"日志系统,您必须:1. 每天创建一个新表(必要时删除旧表)2. 将数据追加到表中并按时间/日期查询

Currently, to implement a "rotating" log system you must either: 1. Create a new table each day (and delete older tables if that is necessary) 2. Append your data to a table and query by time/date

我实际上建议每天创建一个新表.由于 BigQuery 按查询的数据量收费,这对您来说是最经济的,而不必每次都查询整个海量数据集.

I would actually recommend creating a new table for each day. Since BigQuery charges by amount of data queried over, this would be most economical for you, rather than having to query over entire massive datasets every time.

顺便说一下 - 您目前如何收集数据?

By the way - how are you currently collecting your data?

这篇关于Google BigQuery 删除行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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