[SPARK-4459] Change groupBy type parameter from K to U

Please see https://issues.apache.org/jira/browse/SPARK-4459
Also, why is this named `areOdd`?  That's not what this function is doing.