Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: Tim MeagherJust a further clarification on these points ....
A lookup node processes the bottom (or "right" if you prefer that terminology) input first, and loads all of this into memory. It loads this into a hash map, where the lookup key is used as the hash key. Therefore, for records that have duplicate keys, only one unique entry will end up in the hash map, so duplicates are ignored. In this case of a duplicate lookup key, a warning message will be printed.
I think at the moment, the implementation does an overwrite on the hash map, meaning that only the last duplicate in the data set will be used, but this isn't part of the interface and is not guaranteed.
In any case, the lookup will then process on a one-by-one basis the rows in the top (/left) input. Since there are only unique lookup entries in the hash map, it doesn't need to load more than one record from the top (/left) input at a time, so there is never more than one record from the top (/left) input in memory.
In short: If you don't have duplicates on your lookup key, and your lookup data set - the bottom (/right) input - is pretty small, then you can pass as many records as you want through the top (/left) input without it causing any memory issues.
However, you will start to quickly run into memory issues on the lookup node if you have a lot of (unique) records in the bottom (/right) input.
As Maria has rightly pointed out, the join node on the other hand is different, since this will produce a cartesian product (and load this in memory) for cases where the join key matches. However, if there are no duplicates, the join node will generally require less memory than a lookup node, since it doesn't try and load in one side of the input into memory.