Reputation: 11629
If I just use the default sorting comparator and grouping comparator, I guess the ordering of the value lists in Reduce wouldn't be determinstic? It will be random?
Upvotes: 0
Views: 46
Reputation: 5239
You should assume the ordering of values will be random. The default comparator (and all comparators, actually) only compares and groups keys, not values.
The common pattern for rendering the value order deterministic requires sneaking part of the value into the key and ignoring that extra part for the grouping partitioner and comparator, while considering it for the sorting comparator.
Upvotes: 1