Github user DylanGuedes commented on a diff in the pull request:
https://github.com/apache/spark/pull/21045#discussion_r189023172
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CollectionExpressionsSuite.scala
---
@@ -199,6 +200,20 @@ class CollectionExpressionsSuite extends SparkFunSuite
with ExpressionEvalHelper
Some(Literal.create(null, StringType))), null)
}
+ test("Zip") {
+ val lit1 = (Literal.create(Seq(9001, 9002, 9003)),
Literal.create(Seq(4, 5, 6)))
+ val lit2 = (Literal.create(Seq(9001, 9002)), Literal.create(Seq(4, 5,
6)))
+ val lit3 = (Literal.create(Seq("a", "b", null)),
Literal.create(Seq(4)))
+
+ val val1 = List(Row(9001, 4), Row(9002, 5), Row(9003, 6))
+ val val2 = List(Row(9001, 4), Row(9002, 5), Row(null, 6))
+ val val3 = List(Row("a", 4), Row("b", null), Row(null, null))
+
+ checkEvaluation(Zip(Seq(lit1._1, lit1._2)), val1)
+ checkEvaluation(Zip(Seq(lit2._1, lit2._2)), val2)
+ checkEvaluation(Zip(Seq(lit3._1, lit3._2)), val3)
--- End diff --
I added a few tests, but to be fair I don't know how to create a binary
DF/Literal. I checked a few pages/documentation and they all suggest the
notation `b"0101"`, that doesn't seem to work. Suggestions?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]