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

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

问题描述

我有这样的 Json 数组;

<预><代码>[{"item_id": "","时间戳": "",类型": "",价值": ""},{"item_id": "","时间戳": "",类型": "",价值": ""}]

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

但是 PutHBaseRecord 等待我的一个字段.我能做什么?

<小时>

我可以这样做吗?

对于记录阅读器 = JsonPathReader

而且,rowId = concat($item_id, $timestamp, $type) ????

解决方案

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

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

在 UpdateRecord 处理器中添加新属性

rowId连接(/item_id,/时间戳,/类型)

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

参考这个 配置/使用 UpdateRecord 处理器的链接

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

解决方案

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

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

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