[SPARK-2441][SQL] Add more efficient distinct operator.