Trying to process a stream of data by comparing a field to a info-list, then returning an ID from this info-list (if a match is found). So far so good, a fairly simply task. However, this lookup must be done using longest match! This is similar to longest prefix match used with IP-addresses.
Example:
Incoming row with value "10000123"
Info-list:
1000
100001
1000012
100002
1200
The longest match here would be 1000012. The result should be fetching a corresponding ID in this info list.
I tried using recursive sub-transformation, iterating through the various lengths, to try and find the longest match first. Kettle/spoon didn't like that very much, and it stopped/froze. I think the sub-transformation executes even if it doesn't receive any input rows, if that's the case it's not able to break the recursion and will crash into infinity. I don't want to hardcode each iteration (could be very many different lengths in the info-list). So I wonder if there is any other solution than doing it manually in java?