【问题标题】:Jolt Specification颠簸规格
【发布时间】:2020-04-28 07:21:46
【问题描述】:

我有以下输入格式

INPUT.JSON

[
    {
        "name": "adam",
        "age": 12,
        "address": {
            "city": "delhi",
            "country": "india",
            "zip": "110011"
        }
    },

    {
        "name": "louis",
        "age": 23,
        "address": {
            "city": "goa",
            "country": "india",
            "zip": "110022"
        }
    }
]

应用颠簸变换后,我想得到以下输出

期望的输出.JSON

[
    {
        "name": "adam",
        "age": 12,
        "address": {
            "current_city": "delhi",            //change here
            "current_country": "india",         //change here
            "zipode": "110011"                  //change here
        }
    },

    {
        "name": "louis",
        "age": 23,
        "address": {
            "current_city": "goa",              //change here
            "current_country": "india",         //change here
            "zipode": "110022"                  //change here
        }
    }
]

您能帮我了解一下 jolt 规范吗? 谢谢

【问题讨论】:

    标签: etl apache-nifi jolt


    【解决方案1】:

    这可能会有所帮助,

    [
      {
        "operation": "shift",
        "spec": {
          "*": {
            "name": "[&1].name",
            "age": "[&1].age",
            "address": {
              // Shifting inside address object
              "city": "[&2].address.current_city",
              "country": "[&2].address.current_country",
              "zip": "[&2].address.zipode"
            }
          }
        }
      }
    ]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-11
      相关资源
      最近更新 更多