Apache Nifi中PutHBaseRecord中具有多个字段的行标识符 [英] Row Identifier with multiple fields in PutHBaseRecord in Apache Nifi

查看:288
本文介绍了Apache Nifi中PutHBaseRecord中具有多个字段的行标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的Json数组;

I have Json array like this;

[
    {
        "item_id": "",
        "timestamp": "",
        "type": "",
        "value": ""
    },
    {
        "item_id": "",
        "timestamp": "",
        "type": "",
        "value": ""
    }
]

我想为HBase创建行键,就像这样:item_id时间戳类型

I want to create row key for HBase as like this : item_id timestamp type

但是PutHBaseRecord等待我的一个字段.我该怎么办?

But PutHBaseRecord waits one field from me. What can I do?

我可以这样做吗?

对于记录读取器= JsonPathReader

然后,rowId = concat($ item_id,$ timestamp,$ type)吗?

And, rowId = concat($item_id, $timestamp, $type) ????

推荐答案

PutHbaseRecord 处理器之前使用 UpdateRecord 处理器.

Use UpdateRecord processor before PutHbaseRecord processor.

定义记录读取器/写入器控制器服务以包括新添加的字段(row_id)

Defines Record Reader/Writer controller services to include newly added field(row_id)

在UpdateRecord处理器中将新属性添加为

Add new property in UpdateRecord processor as

rowId

concat(/item_id, /timestamp, /type)

然后在 PutHBaseRecord 处理器中,使用 rowId 代替Row Identifier Field Name属性值.

Then in PutHBaseRecord processor use the rowId in place of Row Identifier Field Name property value.

请参考链接,用于配置/使用UpdateRecord处理器

Refer to this link for configure/usage of UpdateRecord processor

这篇关于Apache Nifi中PutHBaseRecord中具有多个字段的行标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆