Ask Your Question
0

How to unpivot after pivoting?

asked 2020-03-02 12:43:24 -0600

gs gravatar image

updated 2020-03-02 23:45:52 -0600

Input:

[
    {
        "id": 1234,
        "xyz":123,
        "details":{},
        ...
    },
    {
        "id": 1234,
        "qwe":345,
        "details":{},
        ...
    },
    {
        "id": 234,
        "poter":098,
        "details":{},
        ...
    },
    {
        "id": 234,
        "cot":0999,
        "details":{},
        ...
    }
]

Output:

[
    {
        id: 1234,
        details:{},
        ...,
        signals: {
            xyz: 123,
            qwe: 345
        }
    },
    {
        id: 234,
        details:{},
        ...,
        signals: {
            poter: 098,
            cot: 0999
        }
    }
]
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-02 14:06:30 -0600

metadaddy gravatar image

There is no Data Collector processor that can easily do this. You can use one of the script evaluators to do it, but you will have to be careful about your groups crossing batch boundaries.

edit flag offensive delete link more

Comments

Thanks for the reply, that's one of the reasons why I am not inclined to use it. It will be a huge performance impact. Btw, what I am trying to achieve is a JDBC lookup for multiple key-values (in a LIST-MAP) within a single MQTT record. Could you pls think of a better way than pivot to achieve it?

gs gravatar imagegs ( 2020-03-02 14:14:40 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-03-02 12:43:24 -0600

Seen: 66 times

Last updated: Mar 02