Support Questions

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

displaying the columns in a column family

avatar
Super Collaborator

the describe command is only giving me the column family and not the columns , how can I see which columns belong to a column family without having to dump the whole table ?

1 ACCEPTED SOLUTION

avatar
Super Collaborator

You need to scan the whole table to get all columns. Each row in HBase can have its own schema.

View solution in original post

5 REPLIES 5

avatar
Super Collaborator

You need to scan the whole table to get all columns. Each row in HBase can have its own schema.

avatar
Super Collaborator

that sounds very odd , so if the table has 1 billon rows and someone asks me to tell which columns it has in a particular column family I have to dump the whole billon rows ?

there has to be some other way

avatar
Super Guru

No, you are incorrect, Sami. HBase knows the set of column families. It does *not* track the set of qualifiers.

avatar

If you know that all rows of the table have same no. of columns then you can just get first row (with scan and limit) and parse the columns names for each column family. otherwise @Sergey Soldatov answer is the only way.

avatar
Contributor

Because HBase is schemaless Data store and each row can have different columns, you will not be able to know all columns without going through all rows.

You can use Apache Phoenix to create table with fix numbers of columns and insert data through Phoenix. (However, if you use the 'dynamic columns' feature in Phoenix, you also could not be 100% sure about all columns if you don't know the design upfront).