Github user ueshin commented on a diff in the pull request:
https://github.com/apache/spark/pull/21073#discussion_r199374458
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
---
@@ -551,6 +551,36 @@ object TypeCoercion {
case None => s
}
+ case m @ MapConcat(children) if children.forall(c =>
MapType.acceptsType(c.dataType)) &&
+ !haveSameType(children) =>
+ val keyTypes =
children.map(_.dataType.asInstanceOf[MapType].keyType)
--- End diff --
Can't we do the same thing as the `Concat` does?
```scala
val types = children.map(_.dataType)
findWiderCommonType(types) match {
case Some(finalDataType) => MapConcat(children.map(Cast(_,
finalDataType)))
case None => m
}
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]