Github user ueshin commented on a diff in the pull request:
https://github.com/apache/spark/pull/21045#discussion_r189788174
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CollectionExpressionsSuite.scala
---
@@ -288,6 +289,88 @@ class CollectionExpressionsSuite extends SparkFunSuite
with ExpressionEvalHelper
Some(Literal.create(null, StringType))), null)
}
+ test("Zip") {
+ val literals = Seq(
+ Literal.create(Seq(9001, 9002, 9003, null), ArrayType(IntegerType)),
+ Literal.create(Seq(null, 1L, null, 4L, 11L), ArrayType(LongType)),
+ Literal.create(Seq(-1, -3, 900, null), ArrayType(IntegerType)),
+ Literal.create(Seq("a", null, "c"), ArrayType(StringType)),
+ Literal.create(Seq(null, false, true), ArrayType(BooleanType)),
+ Literal.create(Seq(1.1, null, 1.3, null), ArrayType(DoubleType)),
+ Literal.create(Seq(), ArrayType(NullType)),
+ Literal.create(Seq(null), ArrayType(NullType)),
+ Literal.create(Seq(192.toByte), ArrayType(ByteType)),
+ Literal.create(
+ Seq(Seq(1, 2, 3), null, Seq(4, 5), Seq(1, null, 3)),
ArrayType(ArrayType(IntegerType))),
+ Literal.create(Seq(Array[Byte](1.toByte, 5.toByte)),
ArrayType(BinaryType))
+ )
+
+ checkEvaluation(Zip(Seq(literals(0), literals(1))),
+ List(Row(9001, null), Row(9002, 1L), Row(9003, null), Row(null, 4L),
Row(null, 11L)))
--- End diff --
nit: why do you use `List` here and the following tests?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]