Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: Tim MeagherHi,
The lookup function is really well suited for such functions & I think that is the best way for you to move forward.
However, you still can also use the find function as Ozgun pointed out.
I think there might have been some confusion on the way that could be used so thought I would try & clarify.
You wouldn't need to have your billions of records in the list - rather, the lookup keys would be in the list - and you also wouldn't need to have a whole lot of if id==1 then, else if id ==2 statements.
Rather, you would have something like:
#Populate your list with all of the 150 ids you want to use - you would have to do something similar with your "in" function anyway...
vlist=list(2,3,...)
#Check if the "id" field in an input record is in the specified list
flag = vlist.find('id') !=-1
#NOTE the above is really almost exactly the same as what you are what you would want with the "in" function using: where 'id' in (2,3,....)
#Now output the data, with the flag
emit *
emit flag as "Flag"
So really, the code is very similar to what you would do using "in", and has the functionality that you want.
Hope this clears up things a bit.
Tim.