Skip to content

Commit 33c5bcc

Browse files
committed
Use forall
1 parent 7d6daa1 commit 33c5bcc

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

sql/core/src/test/scala/org/apache/spark/sql/QueryTest.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,10 @@ object QueryTest {
341341
case (a: Array[_], b: Array[_]) =>
342342
a.length == b.length && a.zip(b).forall { case (l, r) => compare(l, r)}
343343
case (a: Map[_, _], b: Map[_, _]) =>
344-
if (a.size == b.size && a.size > 0) {
345-
a.keys.map { aKey =>
344+
a.size == b.size && a.keys.forall { aKey =>
346345
b.keys.find(bKey => compare(aKey, bKey))
347346
.map(bKey => compare(a(aKey), b(bKey)))
348347
.getOrElse(false)
349-
}.reduce(_ && _)
350-
} else {
351-
a.size == b.size
352348
}
353349
case (a: Iterable[_], b: Iterable[_]) =>
354350
a.size == b.size && a.zip(b).forall { case (l, r) => compare(l, r)}

0 commit comments

Comments
 (0)