Support Questions

Find answers, ask questions, and share your expertise

How to give variable as a row identifier in PutHbaseCell. ?

I have tried to load variable in PutHbaseCell but it will not take any value





Super Guru
@umang s

PutHbasecell processor will work with attributes for row identifier and also even for Table Name,Column Family,Column Qualifier properties, Make sure you are having value for ID attribute associated with the flowfile.

I have some recommendations for your flow

1.Use split json processor if you got an array of json messages as invokehttp processor response

2.Use EvaluateJsonPath processor if the response is json message and extract your id attribute from the flowfile content.

3.if you want to change the id to ID then use updateattribute processor add new property as

ID as ${id}

4.use the same ID in PutHbaseCell processor as Row Identifier

Row Identifier ${ID}

PutHbaseCell Example:-

GenerateFlowfile Processor:-

I had a generateflowfile processor with some custom text as {json_message}

added new attributes to the flowfile by right click and add

cf cf

cq name

ID 1

tab_name test



PutHbaseCell configs:-

Keep the attribute names matching with flowfile attribute names(case sensitive).

Table Name ${tab_name}

Row Identifier ${ID}

Column Family ${cf}

Column Qualifier ${cq}

As we are having all the attribute names with expression language.



Once the data got stored into Hbase table then do

hbase(main)>hbase(main):003:0> scan 'test'
ROW                                             COLUMN+CELL
 1                                              column=cf:name, timestamp=1523369609774, value={"jsonmessage}


If the Answer helped to resolve your issue, Click on Accept button below to accept the answer.