是否可以使用给定前缀删除所有行而不单独删除每个行?
我在一个笨拙的表中有一些记录,即我们“软删除”,即我们用删除的#
将Rowkey的前缀。现在,我们需要摆脱所有这些,有没有简单的方法可以在没有编写脚本的情况下找到所有这些并逐一删除它们?
我希望我可以使用cbt deleteallrows
,但我不想删除表中的所有行,只有那些具有前缀删除的#
的行。
I have some records in a Bigtable table that we "soft deleted" i.e. we prefixed the rowkey with deleted#
. We now need to get rid of all of them, is there an easy way to do this without writing a script to find them all and delete them one by one?
I was hoping I could use cbt deleteallrows
but I don't want to delete all the rows in the table, only those with prefix deleted#
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,在CBT工具中没有对此的支持,因此您必须像可以找到在这里。
您可以在此处使用a python示例emampem 然后
进行ReadRow扫描时,您可能需要过滤出除Rowkey以外的所有内容,因此服务器和应用程序上的负载不大。您可以使用 cell a>并将其设置为1。
检查其他类似情况也可能会有所帮助。
No, there is no support for this in the cbt tool, so you would have to write a script or a program for this like the one you can find here.
You can check out reading data with a prefix here with a python example and then delete it from there.
When doing the readrow scan, you may want to filter out everything except the rowkey, so there isn't as much load on your server and application. You can do that with the cells per row filter and just set that to 1.
It could also be helpful to check this other similar case.
您可以使用API方法
droprowrange
。不幸的是,它似乎还没有在CBT中。https://cloud.google。 com/bigtable/doc/reference/admin/rest/v2/projects.instances.tables/droprowrange
You can use the API method
dropRowRange
. Unfortunately it doesn't seem to be in CBT yet.https://cloud.google.com/bigtable/docs/reference/admin/rest/v2/projects.instances.tables/dropRowRange