Github user ueshin commented on a diff in the pull request: https://github.com/apache/spark/pull/21028#discussion_r182686266 --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CollectionExpressionsSuite.scala --- @@ -106,6 +106,30 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper checkEvaluation(ArrayContains(a3, Literal.create(null, StringType)), null) } + test("ArraysOverlap") { + val a0 = Literal.create(Seq(1, 2, 3), ArrayType(IntegerType)) + val a1 = Literal.create(Seq(4, 5, 3), ArrayType(IntegerType)) + val a2 = Literal.create(Seq(null, 5, 6), ArrayType(IntegerType)) + val a3 = Literal.create(Seq(7, 8), ArrayType(IntegerType)) + val a4 = Literal.create(Seq.empty[Int], ArrayType(IntegerType)) + + val a5 = Literal.create(Seq[String](null, ""), ArrayType(StringType)) + val a6 = Literal.create(Seq[String]("", "abc"), ArrayType(StringType)) + val a7 = Literal.create(Seq[String]("def", "ghi"), ArrayType(StringType)) + + checkEvaluation(ArraysOverlap(a0, a1), true) + checkEvaluation(ArraysOverlap(a0, a2), null) + checkEvaluation(ArraysOverlap(a1, a2), true) + checkEvaluation(ArraysOverlap(a1, a3), false) + checkEvaluation(ArraysOverlap(a0, a4), false) + checkEvaluation(ArraysOverlap(a2, a4), null) + checkEvaluation(ArraysOverlap(a4, a2), null) + + checkEvaluation(ArraysOverlap(a5, a6), true) + checkEvaluation(ArraysOverlap(a5, a7), null) + checkEvaluation(ArraysOverlap(a6, a7), false) + } --- End diff -- Can you add cases for one of the two arguments is `null` and `ArraysOverlap(Seq(null), Seq(null))`?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org