Skip to content

Commit a240707

Browse files
committed
Use forall instead of exists for readability.
1 parent 55221fa commit a240707

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
9393
private[this] def isValidSort(
9494
leftKeys: Seq[Expression],
9595
rightKeys: Seq[Expression]): Boolean = {
96-
!leftKeys.zip(rightKeys).exists { keys =>
96+
leftKeys.zip(rightKeys).forall { keys =>
9797
(keys._1.dataType, keys._2.dataType) match {
98-
case (l: AtomicType, r: AtomicType) => false
99-
case (NullType, NullType) => false
100-
case _ => true
98+
case (l: AtomicType, r: AtomicType) => true
99+
case (NullType, NullType) => true
100+
case _ => false
101101
}
102102
}
103103
}

0 commit comments

Comments
 (0)