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

In-memory lookup workaround

ed_tc
New Contributor III

Hello all,
I faced with issue with in-memory lookup. According to snaplogic documentation, [https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439008/In-Memory+Lookup] it does not supported structured JSON path like '$customer.address. It can work only with values like $customer.
Even if I put mapper before the lookup snap, it doesnโ€™t work.

I have following json document
[{
โ€œItemโ€: {
โ€œdateโ€: โ€œ9999-12-31T00:00:00.000Zโ€,
โ€œGeoArrayโ€: [
{
โ€œGeographyNameโ€: {
โ€œGeographyDescriptionโ€: โ€œN\Aโ€,
โ€œGeographyStateIDโ€: 505074
},
โ€œ@keyโ€: โ€œ1753-01-01 00:00:00.000000;505074;1;1;404500โ€
}
]

}

}]
where geography state is id based on which description should be taken from vocabulary which is stored in separate file like key value pairs.
Basically I need to get following json as a desired result
[{
โ€œItemโ€: {
โ€œdateโ€: โ€œ9999-12-31T00:00:00.000Zโ€,
โ€œGeoArrayโ€: [
{
โ€œGeographyNameโ€: {
โ€œGeographyDescriptionโ€: โ€œN\Aโ€,
โ€œGeographyStateIDโ€: 505074,
โ€œGeographyStateDescriptionโ€: โ€œUtahโ€
},
โ€œ@keyโ€: โ€œ1753-01-01 00:00:00.000000;505074;1;1;404500โ€
}
]

}

}]

Does anybody has any idea how to implement it?

I appreciate any help

1 ACCEPTED SOLUTION

kchaitanya
Employee
Employee

Hi,

Please check the attached pipeline, that uses a mapper to workaround the limitation of in memory snap

InMemory_2019_10_03.slp (10.3 KB)

View solution in original post

3 REPLIES 3

kchaitanya
Employee
Employee

Hi,

Please check the attached pipeline, that uses a mapper to workaround the limitation of in memory snap

InMemory_2019_10_03.slp (10.3 KB)

ed_tc
New Contributor III

Thank you. It works.
I want to share with community one issue. In some cases validation shows incorrect data: in my case I did not find any lookuped value during validation, but when I save the result in file the data was looked up correctly

Preview only uses a subset of data to quickly validate your pipeline while execution uses the full set.
If preview is set to 50 and the first doc that matches the search of your pipeline is in the 51 document, you wonโ€™t see it on validation.

You can set the number of documents used in validation. See Data Preview from a Pipeline in the documentation.


Diane Miller
Community Manager