diff options
author | Davies Liu <davies@databricks.com> | 2014-12-16 21:23:28 -0800 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2014-12-16 21:23:28 -0800 |
commit | ec5c4279edabd5ea2b187aff6662ac07ed825b08 (patch) | |
tree | fdb5b450f4519b2ac88e2713128e3e8a675702a5 /sql | |
parent | 770d8153a5fe400147cc597c8b4b703f0aa00c22 (diff) | |
download | spark-ec5c4279edabd5ea2b187aff6662ac07ed825b08.tar.gz spark-ec5c4279edabd5ea2b187aff6662ac07ed825b08.tar.bz2 spark-ec5c4279edabd5ea2b187aff6662ac07ed825b08.zip |
[SPARK-4866] support StructType as key in MapType
This PR brings support of using StructType(and other hashable types) as key in MapType.
Author: Davies Liu <davies@databricks.com>
Closes #3714 from davies/fix_struct_in_map and squashes the following commits:
68585d7 [Davies Liu] fix primitive types in MapType
9601534 [Davies Liu] support StructType as key in MapType
Diffstat (limited to 'sql')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/execution/pythonUdfs.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/pythonUdfs.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/pythonUdfs.scala index 2b4a88d5e8..5a41399971 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/pythonUdfs.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/pythonUdfs.scala @@ -132,7 +132,7 @@ object EvaluatePython { arr.asInstanceOf[Array[Any]].map(x => toJava(x, array.elementType)) case (obj: Map[_, _], mt: MapType) => obj.map { - case (k, v) => (k, toJava(v, mt.valueType)) // key should be primitive type + case (k, v) => (toJava(k, mt.keyType), toJava(v, mt.valueType)) }.asJava case (ud, udt: UserDefinedType[_]) => toJava(udt.serialize(ud), udt.sqlType) |