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_r378051609
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala
 ##########
 @@ -167,9 +175,9 @@ case class CreateMap(children: Seq[Expression]) extends 
Expression {
   override lazy val dataType: MapType = {
     MapType(
       keyType = 
TypeCoercion.findCommonTypeDifferentOnlyInNullFlags(keys.map(_.dataType))
-        .getOrElse(StringType),
+        .getOrElse(defaultElementType),
 
 Review comment:
   In `ArrayBasedMapBuilder`, we are explicitly asserting that `keyType` can't 
be `NullType`.  So assigning `NullType` here is causing test failures. 
   @cloud-fan  

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to