如何在hbase表中删除一个家族的所有数据? [英] How do I delete all data for a family in hbase table?

查看:112
本文介绍了如何在hbase表中删除一个家族的所有数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个包含多个家族的HBase表,我们需要删除某个家族的所有数据,但其余的不会改变。我们只需要删除数据,然后将家人离开,因为我们将为该家庭重新填写新数据。
最简单的方法似乎是从文件系统中删除与该系列相关的文件(位于../{table_name}/{some_hash}/{family_name}/下)。
这样做是否有任何副作用,我们应该知道?
如果有的话,有没有更安全的方法可以做到这一点? 解决方案

更安全的方法是 deleteColumn 并完全删除系列,然后使用 addColumn 。请注意,在进行这些更改之前,您需要禁用表格


We have an HBase table with multiple families, and we need to delete all data for a certain family, but leave the rest untouched. We only need to delete the data, and leave the family there, as we will be repopulating the table with new data for that family. The simplest way seems to be to delete the files associated with that family from the file system (found under ../{table_name}/{some_hash}/{family_name}/). Are there any side effects to doing this that we should be aware of? If there are, are there any safer, easy ways to do this?

解决方案

The safer way would be to deleteColumn and remove the family completely and then re-add it with addColumn. Note that you need to disable the table before you make these changes

这篇关于如何在hbase表中删除一个家族的所有数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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