Hello,
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.