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

    https://github.com/apache/spark/pull/18284#discussion_r122139485
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/trees/TreeNodeSuite.scala
 ---
    @@ -146,6 +154,17 @@ class TreeNodeSuite extends SparkFunSuite {
         assert(actual === Dummy(None))
       }
     
    +  test("mapChildren should only works on children") {
    +    val children = Seq((Literal(1), Literal(2)))
    +    val nonChildren = Seq((Literal(3), Literal(4)))
    +    val before = SeqTupleExpression(children, nonChildren)
    +    val toZero: PartialFunction[Expression, Expression] = { case 
Literal(_, _) => Literal(0) }
    +    val expect = SeqTupleExpression(Seq((Literal(0), Literal(0))), 
nonChildren)
    +
    +    val actual = before mapChildren toZero
    +    assert(actual === expect)
    --- End diff --
    
    I'm not sure if I understand it wrongly. `===` compared to `==` could 
provide more information about the error. You can see the follow examples:
    
    ```
    scala> assert(1 == 2)
    java.lang.AssertionError: assertion failed
      at scala.Predef$.assert(Predef.scala:156)
      ... 32 elided
    
    ```
    
    ```
    scala> assert(1 === 2)
    <console>:12: error: value === is not a member of Int
           assert(1 === 2)
    
    ```
    
    And also you can check it in 
https://stackoverflow.com/questions/10489548/what-is-the-triple-equals-operator-in-scala-koans


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