首页 > 解决方案 > 需要帮助来创建 Jolt 规范

问题描述

需要有关将 JSON 从共享输入格式转换为预期格式的 JOLT 规范的帮助。

[
  {
    "Header": {
        "TeamCD": 2
    },
    "Player": [
               {
                 "PlayerNumber": 1,
                 "ShortName": "John",
                 "UniformNO": 11,
                 "SmartStart": 20200201,
                 "SmartEnd": 99999999
               }, 
               {
                 "PlayerNumber": 2,
                 "ShortName": "James",
                 "UniformNO": 12,
                 "SmartStart": 20200201,
                 "SmartEnd": 99999999
               }
              ]
  }
]

期望的输出:

[
    {
      "Field": "TeamCD",
      "Type": "20"
      "Value": 2,
      "Vendor": "Vendor1"
    },
    {
    "Field": "PlayerNumber",
    "Type": "23"
    "Value": 1,
    "Vendor": "Vendor1"
  },
  {
    "Field": "ShortName",
    "Type": "24"
    "Value": "John",
    "Vendor": "Vendor1"
  },
  {
    "Field": "PlayerNumber",
    "Type": "23"
    "Value": 2,
    "Vendor": "Vendor1"
  },
  {
    "Field": "ShortName",
    "Type": "24"
    "Value": "James",
    "Vendor": "Vendor1"
  }
]

我现在正在尝试使用 JoltTransformJSON 来实现这一点。这可以使用 JoltTransformJSON 实现吗?我让它在 Nifi 上运行,如果不能使用 Jolt,我有什么选择?

标签: jolt

解决方案


推荐阅读