- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Nested field as Hbase row identifier
- Labels:
-
Apache HBase
-
Apache NiFi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎03-29-2022 04:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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.
Created ‎03-29-2022 04:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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.
