Skip to content

Commit cc02045

Browse files
committed
consider elements length equal
1 parent d7ff8f4 commit cc02045

File tree

1 file changed

+5
-2
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,14 @@ abstract class Expression extends TreeNode[Expression] {
7777
}.toString
7878
}
7979

80-
def semanticEquals(other: Expression): Boolean = this.getClass == other.getClass &&
81-
this.productIterator.zip(other.asInstanceOf[Product].productIterator).forall {
80+
def semanticEquals(other: Expression): Boolean = this.getClass == other.getClass && {
81+
val elements1 = this.productIterator.toSeq
82+
val elements2 = other.asInstanceOf[Product].productIterator.toSeq
83+
elements1.length == elements2.length && elements1.zip(elements2).forall {
8284
case (e1: Expression, e2: Expression) => e1 semanticEquals e2
8385
case (i1, i2) => i1 == i2
8486
}
87+
}
8588
}
8689

8790
abstract class BinaryExpression extends Expression with trees.BinaryNode[Expression] {

0 commit comments

Comments
 (0)