I have two Json payload. I want to merge them in a single Json object

妖精的绣舞 提交于 2019-12-02 04:49:10

Generally NiFi is not meant to do traditional streaming joins, but this recent thread on the mailing list can help explain what is possible:

http://apache-nifi-users-list.2361937.n4.nabble.com/join-two-datasets-td7039.html

Easy! Just use MergeContent and set the following configuration:

Merge Format: Binary Concatenation
Minimum Number of Entries: 2
Delimiter Strategy: Text
Header: [
Footer: ]
Demarcator: ,

(You could use MergeRecord but it is a little buggy for me at least).

Then transfer to JoltTrasnformJSON and set Jolt Transformation DSL to Shift and Jolt Specification to:

{
    "*": {
      "*": "&"
    }
}

This should do the job :)

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