You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by ma qiang <ma...@gmail.com> on 2008/01/20 09:46:01 UTC

without insert method in HTable class

Dear colleagues:
         I don't know how to insert new rows in a table, and there's
no insert method in HTable class. Can you tell me how to insert some
rows in a  new table?
        Thanks.

Best wishes!

Qiang Ma
Department of Computer Science and Engineering
Fudan University
Shanghai, P. R. China
EMail: maqiang1984@gmail.com

Re: without insert method in HTable class

Posted by edward yoon <ed...@mail.udanax.org>.
Try like this :

  HTable table = new HTable(conf, Text tableName);
  long lockId = table.startUpdate(getRow());

  table.put(lockId, Text columnName, byte[] value);
  table.commit(lockId);

On 1/20/08, ma qiang <ma...@gmail.com> wrote:
> Dear colleagues:
>         I don't know how to insert new rows in a table, and there's
> no insert method in HTable class. Can you tell me how to insert some
> rows in a  new table?
>        Thanks.
>
> Best wishes!
>
> Qiang Ma
> Department of Computer Science and Engineering
> Fudan University
> Shanghai, P. R. China
> EMail: maqiang1984@gmail.com
>


-- 
B. Regards,
Edward yoon @ NHN, corp.

Re: without insert method in HTable class

Posted by edward yoon <ed...@mail.udanax.org>.
Try like this:

 HTable table = new HTable(conf, Text tableName);
 long lockId = table.startUpdate(Text row);

 table.put(lockId, Text columnName, byte[] value);
 table.commit(lockId);

On 1/20/08, ma qiang <ma...@gmail.com> wrote:
> Dear colleagues:
>         I don't know how to insert new rows in a table, and there's
> no insert method in HTable class. Can you tell me how to insert some
> rows in a  new table?
>        Thanks.
>
> Best wishes!
>
> Qiang Ma
> Department of Computer Science and Engineering
> Fudan University
> Shanghai, P. R. China
> EMail: maqiang1984@gmail.com
>


-- 
B. Regards,
Edward yoon @ NHN, corp.