Github user henryr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21072#discussion_r181847445
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RemoveRedundantSortsSuite.scala
 ---
    @@ -98,4 +98,31 @@ class RemoveRedundantSortsSuite extends PlanTest {
         val correctAnswer = groupedAndResorted.analyze
         comparePlans(optimized, correctAnswer)
       }
    +
    +  test("remove two consecutive sorts") {
    +    val orderedTwice = testRelation.orderBy('a.asc).orderBy('b.desc)
    +    val optimized = Optimize.execute(orderedTwice.analyze)
    +    val correctAnswer = testRelation.orderBy('b.desc).analyze
    +    comparePlans(optimized, correctAnswer)
    +  }
    --- End diff --
    
    Can you add a test for three consecutive sorts? Two is the base case, three 
will help us show the inductive case :)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to