Yes this code is correct. Here what the code does is only create a column family. What i want to do is inside the column family i want to create several columns. In this documentation <http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html>for the "Class HTableDescripter" it says that addFamily(hcd); creates a column family NOT A Column.
*addFamily <http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#addFamily(org.apache.hadoop.hbase.HColumnDescriptor)>* (HColumnDescriptor<http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HColumnDescriptor.html> family) Adds a column family. In my project what i want to do is create several columns inside that column family. In Hbase Documentation it termed as "qualifier". That is i want to create several qualifiers inside a column family which can be created from the above code snippet. On Tue, Apr 29, 2014 at 11:49 PM, Ted Yu <[email protected]> wrote: > When create your table, you specify the column families in the table (code > snippet from TestFromClientSide3.java): > > HTableDescriptor htd = > newHTableDescriptor(hTable.getTableDescriptor()); > > HColumnDescriptor hcd = new HColumnDescriptor(htd.getFamily(FAMILY)); > > htd.addFamily(hcd); > > admin.createTable(htd); > > When you insert data, you specify column along with data value. > > > Cheers > > > On Tue, Apr 29, 2014 at 11:08 AM, Chamika Kasun <[email protected] > >wrote: > > > Hi all, > > > > Here what i want to do is i want to firstly need to create and a column > > family and then need to create a column for data to be added later. Here > i > > can not use PUT command as it requires a value parameter(because idea of > > that application is first initiate the table and data will be added > later). > > Please help me out. I'm really new to hbase > > > -- Chamika Kasun. Undergraduate. Computer Science & Engineering University of Moratuwa.
