Row Identifier with multiple fields in PutHBaseRec

2019-08-28 19:07发布

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) ????

标签: apache-nifi
1条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-08-28 19:51

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

查看更多
登录 后发表回答