繁体   English   中英

NiFi中的JoltTransformJSON处理器

[英]JoltTransformJSON processor in NiFi

输入:

{ "table": [{
            "_id": {
              "personId": 1234,
              "customer": 345,
              "locale": "en"
          }} ] }

需要以这种格式输出,我的Jolt Spec应该是什么

{
"table": [{
          "personId": 1234,
          "customer": 345,
          "locale": "en"
}]
}

请尝试以下示例:

[
  {
    "operation": "shift",
    "spec": {
      "table": {
        // table items
        "*": {
          // internal object in item under "_id" key
          "*": "table[]"
        }
      }
    }
  }
]

我能够找到解决方案。

[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "*": {
          "_id": {
            "personId": "table[&2].personId",
            "customer": "table[&2].customer",
            "locale": "table[&2].locale"
          }
        }
      }
    }
  }
]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM