I would like to insert a json object into a Hbase cellusing scala, presently i\'m able to insert values using the below code but would like to know how i may be able to insert t
You can encode your json object as a string. then encode this string as byte array. then put this byte array in Hbase. pseudo code will be like this:
json = createYourJson()
jsonString = json.toString
jsonBytyes = Bytes.toBytes(jsonString)
put.add(yourColumnFamily, yourQualifier, jsonBytes)
and when loading the value from hbase you have to reverse this order. Pseudo code will be like this:
jsonBytes = hbase.get(table, columnFamily, qualifier)
jsonString = Bytes.toString(jsonBytes)
json = Json.parse(jsonString)