cloud-fan 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_r378165632
##########
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:
yea we need to handle it. Let's add `NullType` to `case _: AtomicType | _:
CalendarIntervalType if !keyType.isInstanceOf[BinaryType]`
----------------------------------------------------------------
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]