使用Jolt Nifi Spec组合Json Rows

时间:2019-10-29 19:07:38

标签: jolt

输入:

Error : Member is ambiguous: 'A::aa' and 'A::aa' in function `main()`

需要的输出:

[{
    "Store_id": "store_0",
    "Item_id": "item_0",
    "Quantity": "26",
    "Date": "2019-05-01",

}, {
    "Store_id": "store_0",
    "Item_id": "item_0",
    "Quantity": "17",
    "Date": "2019-05-02"
}, {
    "Store_id": "store_0",
    "Item_id": "item_1",
    "Quantity": "47",
    "Date": "2019-05-01",
    "CREATED_DT": "2019-10-09 20:45:47.0",
    "CREATED_BY": "di_user"
}]

1 个答案:

答案 0 :(得分:0)

如果我正确阅读了您的输出,则可以使用以下规范:

[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "Store_id": "order[&1].Store_id",
        "Date": "order[&1].Date",
        "Item_id": "order[&1].items[#].item",
        "Quantity": "order[&1].items[#].Quantity"
      }
    }
  }
]