panbingkun commented on code in PR #47984:
URL: https://github.com/apache/spark/pull/47984#discussion_r1754278893
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CollectionExpressionsSuite.scala:
##########
@@ -137,14 +137,32 @@ class CollectionExpressionsSuite
test("ArrayBinarySearch") {
// primitive type: boolean、byte、short、int、long、float、double
+ // boolean
+ // boolean foldable
Review Comment:
foldable test case
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CollectionExpressionsSuite.scala:
##########
@@ -137,14 +137,32 @@ class CollectionExpressionsSuite
test("ArrayBinarySearch") {
// primitive type: boolean、byte、short、int、long、float、double
+ // boolean
+ // boolean foldable
val a0_0 = Literal.create(Seq(false, true),
ArrayType(BooleanType, containsNull = false))
checkEvaluation(ArrayBinarySearch(a0_0, Literal(true)), 1)
val a0_1 = Literal.create(Seq(null, false, true), ArrayType(BooleanType))
checkEvaluation(ArrayBinarySearch(a0_1, Literal(false)), 1)
val a0_2 = Literal.create(Seq(null, false, true), ArrayType(BooleanType))
checkEvaluation(ArrayBinarySearch(a0_2, Literal(null, BooleanType)), null)
-
+ val a0_3 = CreateArray(Seq(Literal(false), Literal(true)))
+ checkEvaluation(ArrayBinarySearch(a0_3, Literal(true)), 1)
+ val a0_4 = CreateArray(Seq(Literal(null, BooleanType), Literal(false),
Literal(true)))
+ checkEvaluation(ArrayBinarySearch(a0_4, Literal(false)), 1)
+ val a0_5 = CreateArray(Seq(Literal(null, BooleanType), Literal(false),
Literal(true)))
+ checkEvaluation(ArrayBinarySearch(a0_5, Literal(null, BooleanType)), null)
+ // boolean non-foldable
Review Comment:
non-foldable test case
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]