SPARK-2978. Transformation with MR shuffle semantics

I didn't add this to the transformations list in the docs because it's kind of obscure, but would be happy to do so if others think it would be helpful.
nit: 2 space indent for return type (the only place we do 4 space indent is for indenting parameters