Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Jolt transform nested json array

Explorer

How can I break and flatten nested JSON with arrays using Jolt transformations

from:

 

 

 

{
  "product": [
    "data - 1",
    "data - 2"
  ],
  "Purchase": [
    2,
    2
  ],
  "Renewal": 1
}

 

 

 

 

to

 

 

 

 

[
  {
    "product": "data -1",
    "Purchase": 1,
    "Renewal": 1
  },
  {
    "product": "data -2",
    "Purchase": 2,
  }
]

 

 

 

 

My current jolt transformation doesn't give me fully accurate transformation

 

 

 

 

[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "*": {
          "@": "[#2].&2"
        }
      }
    }
  }
]

 

 

 

 

0 REPLIES 0
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.