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

    https://github.com/apache/spark/pull/14841#discussion_r77113690
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/SortOrder.scala
 ---
    @@ -61,6 +61,9 @@ case class SortOrder(child: Expression, direction: 
SortDirection)
       override def sql: String = child.sql + " " + direction.sql
     
       def isAscending: Boolean = direction == Ascending
    +
    +  def semanticEquals(other: SortOrder): Boolean =
    --- End diff --
    
    @cloud-fan : If you look at the old version of `EnsureRequirements` below 
at L253, it compared raw `SortOrder` objects which will use `equals()` 
generated for it. In scala, `equals()` for case classes is merely doing 
`equals()` over all its fields so that lead to `Expression`'s `equals()` being 
used instead of its `semanticEquals()`.
    
    My fix here was to introduce a `semanticEquals` in `SortOrder` which 
compares the underlying `Expression` semantically.


---
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