Chao, Based on our last conversation, I don't think your patch is final or ready to be reviewed. Please continue working on your patch and update when you think it's ready. Here is what I have emphasized:
1. Define a SparkShuffle interface that's similar to existing ShuffleTran.
2. Have two implementation of this interface: sortBy and groupBy.
3. For sortBy, use a local key clustering mechanism.
4. Have ReduceTran contain a reference to SparkShuffle and HiveReduceFunction instance.
Let me know if you have additional questions.