12-18-2018 03:09 AM
Hi All,
This is my first post and I am pleased to be part of this community.
I have been working on a scenario now.
A document has 2 records. For some of the fields in the records I need to do a lookup in tables (1 for each field) to transformation. So I Split the document using JSON Splitter and made a copy for each lookup, at each lookup step, I am joining using Left Outer Join, The problem is, if the sequence of the records is as follows
1st record:
{
Given Name: XYZ
Last Name: ABC
YOB: 1987
}
2nd Record:
{
Given Name: MNY
Last Name: EFG
Age: 30
YOB: 1987
}
The output of the Left outer join is as follows
1st record:
{
Given Name: XYZ
Last Name: ABC
YOB: 1987
}
2nd Record:
{
Given Name: MNY
Last Name: EFG
YOB: 1987
Age: 30
}
Age object is pushed to the bottom in the second record and this causes failure in my pipeline as the objects are not as per sequence to the structure given for validation.
Note: Age is not a mandatory field, but if present it should be next Last Name.
If this is the normal behavior of the Left Outer Join, then please let me know how can i re-sequence the output as expected?
I have tried Sort and Mapper snaps by providing the sequence, but no luck.
Expecting you masters help on this 🙂
Thank and regards,
Sri
12-18-2018 04:51 AM
Hi Sri,
Please find the attached pipeline. It might help you.
sequence of the data_2018_12_18.slp (8.6 KB)
12-18-2018 08:35 AM
Thank you very much for your response Anil. I have modified your pipeline to my problem and attached.
You can see the change in sequence in the Record2 after the join. I need to re-sequence it back to how it was in the right JSON generator. How can I do that?sequence of the data_2018_12_18 (1).slp (7.9 KB)
Thanks and regards,
Sri
12-18-2018 10:16 PM
12-19-2018 12:45 AM
That is super cool. Thank you very much Anil.