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

前端 未结 2 794
被撕碎了的回忆
被撕碎了的回忆 2021-01-23 02:44

I have two payloads and want to merge them into single JSON object (streaming join). At few places people are suggesting to use AttributesToJSON, but as one of the JSON does not

相关标签:
2条回答
  • 2021-01-23 03:13

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

    0 讨论(0)
  • 2021-01-23 03:24

    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

    0 讨论(0)
提交回复
热议问题