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

    https://github.com/apache/spark/pull/22957#discussion_r237818279
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
 ---
    @@ -195,14 +195,35 @@ abstract class Expression extends 
TreeNode[Expression] {
       }
     
       /**
    -   * Returns true when two expressions will always compute the same 
result, even if they differ
    +   * Returns true when two expressions will always compute the same 
output, even if they differ
        * cosmetically (i.e. capitalization of names in attributes may be 
different).
        *
        * See [[Canonicalize]] for more details.
    +   *
    +   * This method should be used (instead of `sameResult`) when comparing 
if 2 expressions are the
    +   * same and one can replace the other (eg. in Optimizer/Analyzer rules 
where we want to replace
    +   * equivalent expressions). It should not be used (and `sameResult` 
should be used instead) when
    +   * comparing if 2 expressions produce the same results (in this case 
`semanticEquals` can be too
    +   * strict).
        */
       def semanticEquals(other: Expression): Boolean =
         deterministic && other.deterministic && canonicalized == 
other.canonicalized
     
    +  /**
    +   * Returns true when two expressions will always compute the same 
result, even if the output may
    +   * be different, because of different names or similar differences.
    --- End diff --
    
    How about replace `output` with `output from plan perspective`?
    
    ```
    Returns true when two expressions will always compute the same result, even 
if the output
    from plan perspective may be different, because of different names or 
similar differences.
    ```


---

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

Reply via email to