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

    https://github.com/apache/spark/pull/16933#discussion_r101911156
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/CollapseRepartitionSuite.scala
 ---
    @@ -43,15 +55,44 @@ class CollapseRepartitionSuite extends PlanTest {
         comparePlans(optimized, correctAnswer)
       }
     
    +  test("collapse one coalesce and one repartition into one") {
    +    val query1 = testRelation
    +      .coalesce(20)
    +      .repartition(5)
    +
    +    val optimized1 = Optimize.execute(query1.analyze)
    +    val correctAnswer1 = testRelation.repartition(5).analyze
    +
    +    comparePlans(optimized1, correctAnswer1)
    +
    +    val query2 = testRelation
    +      .repartition(5)
    +      .coalesce(20)
    +
    +    val optimized2 = Optimize.execute(query2.analyze)
    +    val correctAnswer2 = testRelation.repartition(5).coalesce(20).analyze
    --- End diff --
    
    For improving this rule, we need to clean up the resolution of 
RepartitionByExpression at first.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to