FAQ
Hello,

I want to retrieve the structure of a table, and now I know how to get the
column families of a table, HTable->HTableDescriptor->HColumnDescriptor, but
I was blocked when I trying to find the API to get the columns of a column
family. Anyone knows about this API?

Thanks a lot for your help!

Kind regards,

Hongqi

--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Is-there-a-API-to-get-all-the-columns-of-a-column-family-tp3739607p3739607.html
Sent from the HBase - Developer mailing list archive at Nabble.com.

Search Discussions

  • Stack at Feb 13, 2012 at 4:04 pm

    On Mon, Feb 13, 2012 at 1:25 AM, hongqizh wrote:
    Hello,

    I want to retrieve the structure of a table, and now I know how to get the
    column families of a table, HTable->HTableDescriptor->HColumnDescriptor, but
    I was blocked when I trying to find the API to get the columns of a column
    family. Anyone knows about this API?

    Thanks a lot for your help!
    Its not possible without getting all data in all columns; no two rows
    necessarily have the same columns. But perhaps there was some
    discipline in place inserting data in your case and retrieving all
    data on a particular row will tell you the columns used on all rows?

    St.Ack
  • Doug Meil at Feb 13, 2012 at 4:36 pm
    I'll add this to the book. This comes up from time to time.




    On 2/13/12 11:04 AM, "Stack" wrote:
    On Mon, Feb 13, 2012 at 1:25 AM, hongqizh wrote:
    Hello,

    I want to retrieve the structure of a table, and now I know how to get
    the
    column families of a table,
    HTable->HTableDescriptor->HColumnDescriptor, but
    I was blocked when I trying to find the API to get the columns of a
    column
    family. Anyone knows about this API?

    Thanks a lot for your help!
    Its not possible without getting all data in all columns; no two rows
    necessarily have the same columns. But perhaps there was some
    discipline in place inserting data in your case and retrieving all
    data on a particular row will tell you the columns used on all rows?

    St.Ack
  • Mikael Sitruk at Feb 13, 2012 at 5:37 pm
    Please note there is also
    https://issues.apache.org/jira/browse/HBASE-4882 which
    suggest to add such feature, of course this is just for a specific row and
    does not tell that all the row are the same.

    Mikael.S
    On Mon, Feb 13, 2012 at 6:35 PM, Doug Meil wrote:


    I'll add this to the book. This comes up from time to time.




    On 2/13/12 11:04 AM, "Stack" wrote:
    On Mon, Feb 13, 2012 at 1:25 AM, hongqizh wrote:
    Hello,

    I want to retrieve the structure of a table, and now I know how to get
    the
    column families of a table,
    HTable->HTableDescriptor->HColumnDescriptor, but
    I was blocked when I trying to find the API to get the columns of a
    column
    family. Anyone knows about this API?

    Thanks a lot for your help!
    Its not possible without getting all data in all columns; no two rows
    necessarily have the same columns. But perhaps there was some
    discipline in place inserting data in your case and retrieving all
    data on a particular row will tell you the columns used on all rows?

    St.Ack

    --
    Mikael.S
  • Hongqizh at Feb 14, 2012 at 4:08 am
    Hi St.Ack,

    Thanks for your quick response. In my case, the tables comes from customers
    so I can't modify those tables, and some of the tables are very large(for
    example, one is more than 600MB) , when I scanning all the data of the
    table, the program just does not respond. Do you have a suggestion about
    this kind of case? And I think more and more people will encounter this
    problem, is that possible in future to add the API to get all the column
    names of a column family(such as HColumnDescriptor.getColumnNames() )?

    Kind regards,

    Hongqi

    --
    View this message in context: http://apache-hbase.679495.n3.nabble.com/Is-there-a-API-to-get-all-the-columns-of-a-column-family-tp3739607p3742294.html
    Sent from the HBase - Developer mailing list archive at Nabble.com.
  • Stack at Feb 14, 2012 at 4:16 am

    On Mon, Feb 13, 2012 at 6:00 PM, hongqizh wrote:
    Thanks for your quick response. In my case, the tables comes from customers
    so I can't modify those tables, and some of the tables are very large(for
    example, one is more than 600MB) , when I scanning all the data of the
    table, the program just does not respond.
    Why not? It stops at a particular region? Can you figure which one.
    Is it not deployed anywhere? Grep its name in master logs to see if
    you can figure what happened to it?
    Do you have a suggestion about
    this kind of case? And I think more and more people will encounter this
    problem,  is that possible in future to add the API to get all the column
    names of a column family(such as HColumnDescriptor.getColumnNames() )?
    I don't think we'll be adding such a call; it would imply a full scan
    of the whole table to find every unique column of which there could be
    millions. If the table is big, it'd need to mapreduce for the result
    to come back in any reasonable amount of time.

    St.Ack
  • Hongqizh at Feb 14, 2012 at 4:01 pm

    Why not? It stops at a particular region? Can you figure which one.
    Is it not deployed anywhere? Grep its name in master logs to see if
    you can figure what happened to it?
    It seems that a StackOverflowError happened in my program.
    I don't think we'll be adding such a call; it would imply a full scan
    of the whole table to find every unique column of which there could be
    millions. If the table is big, it'd need to mapreduce for the result
    to come back in any reasonable amount of time.
    Sorry, St.Ack , I'm not very clear about how to mapreduce for the result,
    could you explain more about the mapreduce or give me some link? Thanks
    again for your kind help!


    hongqi

    --
    View this message in context: http://apache-hbase.679495.n3.nabble.com/Is-there-a-API-to-get-all-the-columns-of-a-column-family-tp3739607p3743029.html
    Sent from the HBase - Developer mailing list archive at Nabble.com.
  • Doug Meil at Feb 14, 2012 at 4:05 pm
    There are lots of examples of MapReduce using HBase here...

    http://hbase.apache.org/book.html#mapreduce




    On 2/14/12 3:30 AM, "hongqizh" wrote:

    Why not? It stops at a particular region? Can you figure which one.
    Is it not deployed anywhere? Grep its name in master logs to see if
    you can figure what happened to it?
    It seems that a StackOverflowError happened in my program.
    I don't think we'll be adding such a call; it would imply a full scan
    of the whole table to find every unique column of which there could be
    millions. If the table is big, it'd need to mapreduce for the result
    to come back in any reasonable amount of time.
    Sorry, St.Ack , I'm not very clear about how to mapreduce for the result,
    could you explain more about the mapreduce or give me some link? Thanks
    again for your kind help!


    hongqi

    --
    View this message in context:
    http://apache-hbase.679495.n3.nabble.com/Is-there-a-API-to-get-all-the-col
    umns-of-a-column-family-tp3739607p3743029.html
    Sent from the HBase - Developer mailing list archive at Nabble.com.
  • Enis Söztutar at Feb 14, 2012 at 9:52 pm
    HBase table schema's only pre-define the table's column families, but not
    the columns in it. In the data model, every row defines its own columns, so
    every row potentially can contain different columns. Even if your data has
    fixed columns, there is no way that hbase can determine that. The
    HTableDescriptor object also is not the place for this, since it defines
    the schema of the table, and column names are not in the schema. Please see
    the book on the data model http://hbase.apache.org/book.html#datamodel.

    Having said that, if your data has fixed columns, you can manage those
    definitions externally, or store them in a meta table of your own. Or if
    you want to obtain column names for a single row, you can do so by calling
    Htable.get(), and obtaining the column names from the keys of
    Result.getFamilyMap(). If you are sure that all the rows contain the same
    columns, then, you can do something like, get the first row, get the
    columns of the first row.

    Thanks,
    Enis
    On Tue, Feb 14, 2012 at 12:30 AM, hongqizh wrote:

    Why not? It stops at a particular region? Can you figure which one.
    Is it not deployed anywhere? Grep its name in master logs to see if
    you can figure what happened to it?
    It seems that a StackOverflowError happened in my program.
    I don't think we'll be adding such a call; it would imply a full scan
    of the whole table to find every unique column of which there could be
    millions. If the table is big, it'd need to mapreduce for the result
    to come back in any reasonable amount of time.
    Sorry, St.Ack , I'm not very clear about how to mapreduce for the result,
    could you explain more about the mapreduce or give me some link? Thanks
    again for your kind help!


    hongqi

    --
    View this message in context:
    http://apache-hbase.679495.n3.nabble.com/Is-there-a-API-to-get-all-the-columns-of-a-column-family-tp3739607p3743029.html
    Sent from the HBase - Developer mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categorieshbase, hadoop
postedFeb 13, '12 at 4:02p
activeFeb 14, '12 at 9:52p
posts9
users5
websitehbase.apache.org

People

Translate

site design / logo © 2022 Grokbase