this looks like a bug to me: Hive and Shark reuse Text instances for reducing GC pressure (which is why the getLength method is provided on Text). If you have to compute uniques and store them in a set, you need to copy the Text, otherwise you are computing incorrect results.