hadoop-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Something Something <luckyguy2...@yahoo.com>
Subject ArrayList as a column value?
Date Tue, 29 Sep 2009 22:02:00 GMT

How do I add values from an ArrayList to a column in a HTable?

Let's say I have a "Product" table with columns:  name, desc.  Now I
want to add to each row a list of categories that a product belongs
to.  I tried the following:

        for (String category : categories) {

          put.add(Bytes.toBytes("info"), Bytes.toBytes("categories"), Bytes.toBytes(category));


This doesn't work as expected.  It only keeps one (last) category.  The
rest get overwritten.  I tried using 'version', but that didn't work
either.  There's a put(KeyValue) method.  Is that the one I am supposed
to use?

Any help in this regard will be greatly appreciated.  Thanks.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message