Reply
New Contributor
Posts: 3
Registered: ‎02-07-2016

POST a json to a flume agent - the custom serializer only saving the last json object in hbase

Hi,

 

I am posting a json to a flume agent, I am using the same serializer as here with some changes :

 

https://blogs.apache.org/flume/entry/streaming_data_into_apache_hbase

 

trying to serialize my body which look like this : [{"test" : "a", "data": 1}, {"test" : "b", "data": 2}]

 

so I am looping over the json array but only the last object is hbase due to the PutRequest:

 

 

 PutRequest req = new PutRequest(table, currentRowKey, colFam,              columnNames[i], cols[i].getBytes());      puts.add(req);

 

 

any idea what is wrong? is it related to the fact I have one row key while I have to insert many rows? how to solve it?

Highlighted
Posts: 1,885
Kudos: 424
Solutions: 299
Registered: ‎07-31-2013

Re: POST a json to a flume agent - the custom serializer only saving the last json object in hbase

> any idea what is wrong? is it related to the fact I have one row key while I have to insert many rows? how to solve it?

Is the issue that for a single row key you're only seeing one column being persisted (i.e. only the last one from your array, as you describe), or are you trying to make it such that you get multiple rows from your array?

If the former, how are you inspecting the data on the HBase-end? Via a "get"?
Announcements
New solutions