Hash codes can be negative. Make sure you handle that case. The hash codes can also be larger than the number of partitions, so make sure you handle that too. We recommend you look at SHJOperator's implementation to make sure you partition correctly with hash codes.
This means that you're doing recursive partitioning infinitely. The most likely cause of this is partitioning using the the same hash function every single time. Make sure to update your hash func calls so that the hash function is updated each time.
If you're certain that you're doing both of those things, make sure your condition for recursive partitioning is correct. An off by one (for example <=
vs <
) is enough to make it so you never reach the build and probe phase.
Make sure every time you make a recursive call to run that you increment the pass number.
Make sure when you recursively call run that you add all of the resulting records to your output. Additionally make sure that whenever you call buildAndProbe that you also add those records to your output.