Created 07-11-2017 07:53 PM
I am trying to create SimpleKeyValueLookupService. The usage document says:
"the coordinates that are passed to the lookup must contain the key 'key'."
What does that mean? Does it mean one of the properties created should have the name "key"? or can it have any name?
Can I dynamically add/change properties to this LookupService or is it static?
Thanks!
Created 07-11-2017 08:10 PM
In SimpleKeyValueLookupService you can add as many user-defined properties as you want, lets say for example you added:
field1 = value1 field2 = value2 field3 = value3
Then you would use LookupRecord processor and add a user-defined property like:
key = field1
The LookupRecord processor is going to pass a Map with "key" -> "field1" to the SimpleKeyValueLookupService, the service is going to take the value of "key" which is "field1" and then lookup the value of that which is "value1".
When "value1" is returned to the processor it will be placed in each record in the location specified by "Result Record Path". So if your schema had a field called "lookupValue" and you set "Result Record Path" to "/lookupValue" then after passing through this processor, every record would have the field "lookupValue" set to "value1".
Created on 07-12-2017 03:12 PM - edited 08-18-2019 01:34 AM
Thank you very much Bryan! Now, I am able to lookup the attribute and get the value for that key.
But, I am still confused on how the "Result RecordPath" works. This is how I have configured my Lookup Service:
But, when I am done with the lookup and check out DataProvenance, I do not see any field or attribute called "token". The value that is returned by the lookup now goes into a new attribute "key" (which now has a value "def". I was intending the value to go to "token" attribute. How do I do that?
I have also attached my process flow XML (test-lookupattribute.xml).
Can you point me to any other documentation (if any) other than the Usage documents to figure out exactly how to use the LookupXXXXService processors?
Thanks!
VJ