It is a little bit risky to use a hash set here. The worst case is that this hash set needs to store every ratings on this partition and it runs out of memory.