spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenghao-intel <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-3198] [SQL] Remove the TreeNode.id
Date Fri, 29 Aug 2014 01:13:10 GMT
Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2155#discussion_r16877707
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala
---
    @@ -34,28 +29,13 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] {
       def children: Seq[BaseType]
     
       /**
    -   * A globally unique id for this specific instance. Not preserved across copies.
    -   * Unlike `equals`, `id` can be used to differentiate distinct but structurally
    -   * identical branches of a tree.
    -   */
    -  val id = TreeNode.nextId()
    -
    -  /**
    -   * Returns true if other is the same [[catalyst.trees.TreeNode TreeNode]] instance.
 Unlike
    -   * `equals` this function will return false for different instances of structurally
identical
    -   * trees.
    -   */
    -  def sameInstance(other: TreeNode[_]): Boolean = {
    -    this.id == other.id
    -  }
    -
    -  /**
        * Faster version of equality which short-circuits when two treeNodes are the same
instance.
        * We don't just override Object.Equals, as doing so prevents the scala compiler from
from
        * generating case class `equals` methods
        */
       def fastEquals(other: TreeNode[_]): Boolean = {
    -    sameInstance(other) || this == other
    +    // TODO we need to figure how to do that in a faster way.
    --- End diff --
    
    Yes, exactly. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message