Research breakthrough possible @S-Logix pro@slogix.in

Office Address

Social List

How to insert the data in HBase table?

  • Sample code Segment
    Configuration config = HBaseConfiguration.create();
    HBaseAdmin h1 = new HBaseAdmin(config);
    HTableDescriptor h2 = new HTableDescriptor(“tablename”);
    h2.addFamily(new HColumnDescriptor(“columnfamily”));
    h1.createTable(h2);
    HTable table=new HTable(config, “tablename”);
    Put p=new Put(rowname);
    P.add(columnfamily,columnname,columnvalue);
    table.put(p);
  • Command
    hbase< put ‘tablename’, ‘rowname’, ‘columnfamily:columnname’, ‘columnvalue’