Sorry for the late bump...
It is quite nice to store JSON as strings in HBase, i.e. use for
example JSONObject to convert to something like "{ "name' : "lars" }"
and then Bytes.toBytes(jsonString). Since Hive now has a HBase handler
you can use Hive and its built in JSON support to query cells lik
My use of HBase is essentially what Stack describes: I serialize little log
entry objects with (mostly) protobuf and store them in a single cell in HBase.
I did this at first because it was easy, and made a note to go back and break
out the fields into their own columns, and in fact into multip
on).
>
> Does that make sense?
> Dave
>
>
> -Original Message-
> From: Pablo Molnar [mailto:pablomol...@gmail.com]
> Sent: Monday, January 31, 2011 12:09 PM
> To: user@hbase.apache.org
> Subject: Re: Persist JSON into HBase
>
> Thanks for the fe
?
Dave
-Original Message-
From: Pablo Molnar [mailto:pablomol...@gmail.com]
Sent: Monday, January 31, 2011 12:09 PM
To: user@hbase.apache.org
Subject: Re: Persist JSON into HBase
Thanks for the feedback Stack!
So you suggest to just serialize the JSON represent as a String or as a Map?
So
Thanks for the feedback Stack!
So you suggest to just serialize the JSON represent as a String or as a Map?
Something like this:
(supposing item is a String or a Map)
Put row = new Put(Bytes.toBytes(item.id))
row.add(Bytes.toBytes("json"), Bytes.toBytes("1"), Bytes.toBytes(item))
table.put(row)
Don't use MapWritable.
In the layer above HBase, inside whatever is hosting the HBase client,
serialize the JSON to bytes and then write that to an HBase cell. In
the same layer, reading, do the deserializations.
HBase only does byte arrays.
St.Ack
On Mon, Jan 31, 2011 at 11:30 AM, Pablo Moln
Hi everyone,
In my company we are experimenting with HBase and I'd like to know the best
way to persist a semi-structured complex (3 levels) entity represented as
JSON to HBase.
I've already done successfully a Java client that persist rows in a table
and now my target is persist this JSON.
I've