Ditto. Try

~~~
val ht = iter.map(rat => (userPartitioner.getPartition(rat.product), rat.user)).toSet
~~~