问题
I have Json array like this;
[
{
"item_id": "",
"timestamp": "",
"type": "",
"value": ""
},
{
"item_id": "",
"timestamp": "",
"type": "",
"value": ""
}
]
I want to create row key for HBase as like this : item_id timestamp type
But PutHBaseRecord waits one field from me. What can I do?
Can I do something like that?
For record reader = JsonPathReader
And, rowId = concat($item_id, $timestamp, $type) ????
回答1:
Use UpdateRecord
processor before PutHbaseRecord
processor.
Defines Record Reader/Writer controller services to include newly added field(row_id)
Add new property in UpdateRecord processor as
rowId
concat(/item_id, /timestamp, /type)
Then in PutHBaseRecord processor use the rowId in place of Row Identifier Field Name
property value.
Refer to this link for configure/usage of UpdateRecord processor
来源:https://stackoverflow.com/questions/55005395/row-identifier-with-multiple-fields-in-puthbaserecord-in-apache-nifi