Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Rename the HBase column family without losing the data.

avatar
Contributor

I would like to rename the existing hbase column family. I have tried using the alter delete and create where the data in the old column family got deleted. Is there any way where we can rename the coulmn family.

3 REPLIES 3

avatar
Super Guru

No, you cannot "rename" a column family in one atomic operation. To "rename", you must rewrite the data with the new column family. Then, you can simply drop the old column family.

avatar
Contributor

@Josh Elser Could you please let me know what do you mean by "rewrite the data with the new column family"? You mean to create a new table and copy the current hbase data to new hbase table and drop the old table?

avatar
Super Guru

You do not need to create a new table. You can use the existing table if you alter it to add the new column family.

"rewrit[ing] the data" means that you must read all data and write it again using the new column family. Whether you read it from HBase or from its original form is of no consequence.