Row Identifier with multiple fields in PutHBaseRecord in Apache Nifi

天大地大妈咪最大 提交于 2019-12-25 01:43:49

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!