Member since
08-01-2021
7
Posts
1
Kudos Received
0
Solutions
02-22-2022
11:48 PM
1 Kudo
THANK YOU SO MUCH. It makes total sense.
... View more
02-22-2022
03:44 AM
Thank you so much @araujo for the help. Is it possible to have the new flatten array and the original array within one jolt spec? This is the current structure can we change it to this:
... View more
02-18-2022
07:31 AM
Hi everyone! I hope all is well. I have this json { "Data": { "ID": "09878666", "DATE": "2022-01-01", "ARRAY_ONE": [ { "NAME": "test_1", "details": [ { "address": "123123" } ] }, { "NAME": "test_2", "details": [ { "address": "123123" }, { "address": "123123" } ] } ] } } and I transformed the structure to this: [ { "ID": "09878666", "DATE": "2022-01-01", "NAME": "test_1", "details": [ { "address": "123123" } ] }, { "ID": "09878666", "DATE": "2022-01-01", "NAME": "test_2", "details": [ { "address": "123123" }, { "address": "123123" } ] } ] Which is perfect except for the inner arrays, I want to flatten the array to be like this [ { "ID": "09878666", "DATE": "2022-01-01", "NAME": "test_1", "details_0_adrress":"123123" }, { "ID": "09878666", "DATE": "2022-01-01", "NAME": "test_2", "details_0_adrress":"123123", "details_1_adrress":"123123" } ] Here is my spec: [ { "operation": "shift", "spec": { "Data": { "ARRAY_ONE": { "*": { "@(2,ID)": "[#2].ID", "@(2,DATE)": "[#2].DATE", "NAME": "[#2].NAME", "details": "[#2].details" } } } } } ] I know how to flatten an array but I'm not sure how to do it using the current spec:, What I would normally do is something like this: { "operation": "shift", "spec": { "details": { "*": { "address": "details_&1_address" } } } } But it did not work so well. Thank you!
... View more
Labels:
- Labels:
-
Apache Airflow