added group by and partition of a collect. generate a map with a set inside