iRakson commented on a change in pull request #27542: [SPARK-30790]The dataType
of map() should be map<null,null>
URL: https://github.com/apache/spark/pull/27542#discussion_r378141853
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/ArrayBasedMapBuilder.scala
##########
@@ -29,12 +29,11 @@ import org.apache.spark.unsafe.array.ByteArrayMethods
*/
class ArrayBasedMapBuilder(keyType: DataType, valueType: DataType) extends
Serializable {
assert(!keyType.existsRecursively(_.isInstanceOf[MapType]), "key of map
cannot be/contain map")
- assert(keyType != NullType, "map key cannot be null type.")
private lazy val keyToIndex = keyType match {
// Binary type data is `byte[]`, which can't use `==` to check equality.
- case _: AtomicType | _: CalendarIntervalType if
!keyType.isInstanceOf[BinaryType] =>
- new java.util.HashMap[Any, Int]()
+ case _: AtomicType | _: CalendarIntervalType | _: NullType
Review comment:
This is done to handle this ->
`scala.MatchError: NullType (of class org.apache.spark.sql.types.NullType$)`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]