Skip to content

Commit 0a0834f

Browse files
sisihjmarmbrus
authored andcommitted
AttributeSet.equal should compare size
1 parent 4fc4d03 commit 0a0834f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/AttributeSet.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class AttributeSet private (val baseSet: Set[AttributeEquals])
5858

5959
/** Returns true if the members of this AttributeSet and other are the same. */
6060
override def equals(other: Any): Boolean = other match {
61-
case otherSet: AttributeSet => baseSet.map(_.a).forall(otherSet.contains)
61+
case otherSet: AttributeSet =>
62+
otherSet.size == baseSet.size && baseSet.map(_.a).forall(otherSet.contains)
6263
case _ => false
6364
}
6465

0 commit comments

Comments
 (0)