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

dmiller
Former Employee

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