diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala index 3d0e016a091cf6066e70bc1dfb8a6750befdde31..5eb8fdf048e288533b76e90e15665fddb52113bc 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala @@ -71,7 +71,9 @@ object CurrentOrigin { } } +// scalastyle:off abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product { +// scalastyle:on self: BaseType => val origin: Origin = CurrentOrigin.get @@ -84,6 +86,9 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product { lazy val containsChild: Set[TreeNode[_]] = children.toSet + private lazy val _hashCode: Int = scala.util.hashing.MurmurHash3.productHash(this) + override def hashCode(): Int = _hashCode + /** * 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