Origamer7
Origamer7

Reputation: 345

How can I rename a "column family" in HBase?

I am using the HBase Shell and I have created a table with name 'student' and a column family called 'studentData'.

create 'student', 'studentData'

In the column family I have columns such as 'studentData:name', studentData:surname' and I have filled the table with data.

     ROW                                COLUMN+CELL                                                                                        
     1                                 column=studentData:name, timestamp=1489151422978, value=John                                       
     1                                 column=studentData:surname, timestamp=1489151401190, value=Black                                   
     2                                 column=studentData:name, timestamp=1489151432721, value=Kate                                       
     2                                 column=studentData:surname, timestamp=1489151447623, value=Red
    ...                                ...
    ...                                ...

I would like to rename the column family from 'studentData' to 'data', without deleting the data which are stored in the columns which are under the column family, but unfortunately I have not found a way to do that yet.

In case you have any idea, how to rename a column family, please let me know.

Upvotes: 2

Views: 1845

Answers (1)

seshadri mandal
seshadri mandal

Reputation: 39

We can not.

A column family cannot be renamed. The common approach to rename a family is to create a new family with the desired name and copy the data over, using the API.

Reference Hbase - The Definitve Guide.

Upvotes: 1

Related Questions