Github user ueshin commented on a diff in the pull request:
https://github.com/apache/spark/pull/21073#discussion_r199722217
--- 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 --
As for 1), I submitted a pr #21703. I'm not sure we can merge it yet, but
it will help you improve this pr.
As for 2), Adding casts to the same type should not be the problem because
the extra casts will be removed during the optimization phase.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]