Support Questions
Find answers, ask questions, and share your expertise

Nested field as Hbase row identifier

New Contributor

I have a JSON document that I want to index into Hbase.

 

{
    "field1" : {
        "nestedfield" : "value1"
    }
    "field2" : "value2"
}

 

In this case I want `nestedfield` to be the one used as a row identifier field, but I can't figure out how to specify this to the `PutHBaseJson` processor. I have tried multiple ways :

- field1/nestedfiled

- field1['nestedfiled']

- field1.nestedfield

- $.filed1.nestedfiled

None of them are working, the processor is saying that "the Row ID was null".

Using `field2` for this purpose is working fwiw.

1 ACCEPTED SOLUTION

Master Collaborator

@sheep ,

 

You need to add an EvaluateJsonPath processor before your PutHBaseJson to extract the value that you need and save it as an attribute in the flowfile. For example, you could get the value from $.field1.nestedfield and save that as the attribute mynestedfieldvalue. You can then refer to that attribute in your PutHBaseJson processor as ${mynestedfieldvalue}.

 

Please check out this other answer to a similar question: https://community.cloudera.com/t5/Support-Questions/Hash-key-value-missing-putdynamodb-nifi/m-p/3396...

 

Cheers,

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

View solution in original post

1 REPLY 1

Master Collaborator

@sheep ,

 

You need to add an EvaluateJsonPath processor before your PutHBaseJson to extract the value that you need and save it as an attribute in the flowfile. For example, you could get the value from $.field1.nestedfield and save that as the attribute mynestedfieldvalue. You can then refer to that attribute in your PutHBaseJson processor as ${mynestedfieldvalue}.

 

Please check out this other answer to a similar question: https://community.cloudera.com/t5/Support-Questions/Hash-key-value-missing-putdynamodb-nifi/m-p/3396...

 

Cheers,

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.
; ;