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

Please see https://issues.apache.org/jira/browse/SPARK-4459
Also, you could just write `Tuple2` instead of `scala.Tuple2`.