[SPARK-2726] and [SPARK-2727] Remove SortOrder and do in-place sort.