You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by bharath vissapragada <bh...@students.iiit.ac.in> on 2009/07/19 11:26:05 UTC

Column names of a table in Hbase

Hi all ,

Sorry if this question has already been discussed ..

I want to extract the all the column-names of a table . Can anyone tell me
the corresponding function .
I have googled it but none of the results gave me the correct answer .

Thanks in advance

Re: Column names of a table in Hbase

Posted by Erik Holstad <er...@gmail.com>.
Hi Bharath!
Depending if you want to get the families names only or the combination
family + qualifier there are different ways of doing this.
If you just want the family names, you can do as Tim suggested
getTableDescriptor().getFamilies().
But if you want to get all the columns(Family + qualifier) there is no other
way of doing this at the moment, but to do a full scan of that table.
We have been talking about making some extra counter calls, might be able to
work this call in there too.

Regards Erik

Re: Column names of a table in Hbase

Posted by bharath vissapragada <bh...@gmail.com>.
Thanks for ur reply Tim , Iam using Java API only (sorry for not mentioning
that in my previous mail)

On Sun, Jul 19, 2009 at 3:15 PM, tim robertson <ti...@gmail.com>wrote:

> If you are working in Java, I *think* you get this from the
> HTable.getTableDescriptor(), then get the HColumnDescriptor for each
> family and ask for it's values.
>
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/HTable.html#getTableDescriptor()<http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/HTable.html#getTableDescriptor%28%29>
>
> If you're not working in Java, please let us know how you are
> interacting; REST, terminal etc
>
> Cheers,
> Tim
>
>
> On Sun, Jul 19, 2009 at 11:26 AM, bharath
> vissapragada<bh...@students.iiit.ac.in> wrote:
> > Hi all ,
> >
> > Sorry if this question has already been discussed ..
> >
> > I want to extract the all the column-names of a table . Can anyone tell
> me
> > the corresponding function .
> > I have googled it but none of the results gave me the correct answer .
> >
> > Thanks in advance
> >
>

Re: Column names of a table in Hbase

Posted by tim robertson <ti...@gmail.com>.
If you are working in Java, I *think* you get this from the
HTable.getTableDescriptor(), then get the HColumnDescriptor for each
family and ask for it's values.
http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/HTable.html#getTableDescriptor()

If you're not working in Java, please let us know how you are
interacting; REST, terminal etc

Cheers,
Tim


On Sun, Jul 19, 2009 at 11:26 AM, bharath
vissapragada<bh...@students.iiit.ac.in> wrote:
> Hi all ,
>
> Sorry if this question has already been discussed ..
>
> I want to extract the all the column-names of a table . Can anyone tell me
> the corresponding function .
> I have googled it but none of the results gave me the correct answer .
>
> Thanks in advance
>