Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/21361#discussion_r189457834
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/complexTypesSuite.scala
---
@@ -439,4 +439,17 @@ class ComplexTypesSuite extends PlanTest with
ExpressionEvalHelper {
.select('c as 'sCol2, 'a as 'sCol1)
checkRule(originalQuery, correctAnswer)
}
+
+ test("SPARK-24313: support complex types as map keys") {
+ val mb0 = Literal.create(
+ Map(Array[Byte](1, 2) -> "1", Array[Byte](3, 4) -> null,
Array[Byte](2, 1) -> "2"),
+ MapType(BinaryType, StringType))
--- End diff --
I changed the test name here and the comment for `ElementAt` because I
found an issue in using arrays as keys for map. When I do that, I get:
```
Caused by: java.lang.ClassCastException:
scala.collection.immutable.$colon$colon cannot be cast to
org.apache.spark.sql.catalyst.util.ArrayData
```
I will investigate this further, but I think this is a separate issue and
should be addressed in another PR, what do you think?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]