Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Rename the HBase column family without losing the data.

Highlighted

Rename the HBase column family without losing the data.

New 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

Re: Rename the HBase column family without losing the data.

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.

Re: Rename the HBase column family without losing the data.

New 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?

Re: Rename the HBase column family without losing the data.

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.