TEZ-981. Port MAPREDUCE-3685. (sseth)