cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Join with Merge functionality

patan
New Contributor III

I am using the Join snap with merge to take the output from two different pipeline execute snaps invoked from the same parent pipeline.

Parent pipeline as shown below:

image

I am passing the same input to both pipeline execute snaps by using the copy snap. There is a chance of the fetchPDF pipeline might fail when it is able to find the respective PDF in which case there will not any input for the same.

Input:

[{
โ€œPathโ€: โ€œsldb:///ZipDemo/108600000001.xmlโ€
}, {
โ€œPathโ€: โ€œsldb:///ZipDemo/108600000002.xmlโ€
}, {
โ€œPathโ€: โ€œsldb:///ZipDemo/108600000003.xmlโ€
}]

=================================
Join snap is producing the below output:

[{
โ€œxmlStorageLocationโ€: โ€œZipDemo/storage/108600000001.xmlโ€,
โ€œoriginalโ€: {
โ€œPathโ€: โ€œsldb:///ZipDemo/108600000001.xmlโ€
},
โ€œpdfStorageLocationโ€: โ€œZipDemo/storage/108600000002.pdfโ€,
โ€œinput1_originalโ€: {
โ€œPathโ€: โ€œsldb:///ZipDemo/108600000002.xmlโ€
}
}, {
โ€œxmlStorageLocationโ€: โ€œZipDemo/storage/108600000002.xmlโ€,
โ€œoriginalโ€: {
โ€œPathโ€: โ€œsldb:///ZipDemo/108600000002.xmlโ€
}
}, {
โ€œxmlStorageLocationโ€: โ€œZipDemo/storage/108600000003.xmlโ€,
โ€œoriginalโ€: {
โ€œPathโ€: โ€œsldb:///ZipDemo/108600000003.xmlโ€
}
}]

=========================
But the expected output should like below:

[{
โ€œxmlStorageLocationโ€: โ€œZipDemo/storage/108600000001.xmlโ€,
โ€œoriginalโ€: {
โ€œPathโ€: โ€œsldb:///ZipDemo/108600000001.xmlโ€
}
}, {
โ€œxmlStorageLocationโ€: โ€œZipDemo/storage/108600000002.xmlโ€,
โ€œoriginalโ€: {
โ€œPathโ€: โ€œsldb:///ZipDemo/108600000002.xmlโ€
},
โ€œpdfStorageLocationโ€: โ€œZipDemo/storage/108600000002.pdfโ€,
โ€œinput1_originalโ€: {
โ€œPathโ€: โ€œsldb:///ZipDemo/108600000002.xmlโ€
}
}, {
โ€œxmlStorageLocationโ€: โ€œZipDemo/storage/108600000003.xmlโ€,
โ€œoriginalโ€: {
โ€œPathโ€: โ€œsldb:///ZipDemo/108600000003.xmlโ€
}
}]

====================================

see the below screenshot:

image

Can somebody can help me in understanding the behaviour.
pipeline: Join-Behaviour_2020_11_05.slp (9.6 KB)

1 ACCEPTED SOLUTION

vmaitra1
New Contributor

Hi Patan,

You can try left outer join with $original.path as join condition for both left and right paths. Merge will simply combine the left and right docs and if there is a difference in count then it will join incorrectly. With left outer join all the output docs for create will be present with the corresponding fetch results.

Thanks, V

View solution in original post

1 REPLY 1

vmaitra1
New Contributor

Hi Patan,

You can try left outer join with $original.path as join condition for both left and right paths. Merge will simply combine the left and right docs and if there is a difference in count then it will join incorrectly. With left outer join all the output docs for create will be present with the corresponding fetch results.

Thanks, V