I have a list of JSON's which need to be read and inserted as JSON objects into HBase. Each JSON (could be a nested JSON) needs to be read from the list and inserted along with a new row key
put (key, <json>)
Format:
[
{
"x":"x-val",
"y":222,
"z":{
"m":"m-val",
"n":"n-val"
}
},
{
..
}
]
You can use
json.dumps(dict)
to convert a dictionary to a JSON string.I recommend
happybase
to connect to HBase and store the JSON, as shown here. You can either loop over thejson_data
and do multiple puts, or explore happybase'sbatch
functionality.