SPARK-1072 Use binary search when needed in RangePartioner