Description
As pointed out in SPARK-23368, as of now there is no rule to remove the Sort operator on an already sorted plan, ie. if we have a query like:
SELECT b FROM ( SELECT a, b FROM table1 ORDER BY a ) t ORDER BY a
The sort is actually executed twice, even though it is not needed.