Support Questions
Find answers, ask questions, and share your expertise

displaying the columns in a column family

Master 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

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

Super Collaborator

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

Master 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

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

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.

Explorer

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).

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.