- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Jolt transform
- Labels:
-
Apache NiFi
Created on ‎11-23-2021 07:23 AM - edited ‎11-23-2021 07:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone! I need a help in Jolt transform.
I have array, that consist from many json objects. (https://jolt-demo.appspot.com/ )
[
{
"table_name": "table_vd",
"scratch_name": "l1_sample_1_1",
"scratch_order": 1
},
{
"table_name": "table_vd",
"scratch_name": "l1_sample_1_1",
"scratch_order": 34
},
{
"table_name": "table_vd",
"scratch_name": "l1_sample_2",
"scratch_order": 3
}
]
What transformation of Jolt needs to be done to get the following result?
Now i have next Jolt construction.
[
{
"operation": "shift",
"spec": {
"*": {
"table_name": "table_name",
"*": { "@0": "data[0].&1" }
}
}
}
]
But the result is not correct.
Created ‎11-24-2021 12:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This task has been successfully solved! The required Jolt construction is shown below.
[
{
"operation": "shift",
"spec": {
"*": {
"table_name": "&",
"*": "data[&1].&"
}
}
},
{
"operation": "cardinality",
"spec": {
"table_name": "ONE"
}
}
]
Created ‎11-24-2021 12:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This task has been successfully solved! The required Jolt construction is shown below.
[
{
"operation": "shift",
"spec": {
"*": {
"table_name": "&",
"*": "data[&1].&"
}
}
},
{
"operation": "cardinality",
"spec": {
"table_name": "ONE"
}
}
]
