Github user ueshin commented on a diff in the pull request:
https://github.com/apache/spark/pull/23045#discussion_r234502854
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
---
@@ -521,13 +521,18 @@ case class MapEntries(child: Expression) extends
UnaryExpression with ExpectsInp
case class MapConcat(children: Seq[Expression]) extends
ComplexTypeMergingExpression {
override def checkInputDataTypes(): TypeCheckResult = {
- var funcName = s"function $prettyName"
+ val funcName = s"function $prettyName"
if (children.exists(!_.dataType.isInstanceOf[MapType])) {
TypeCheckResult.TypeCheckFailure(
s"input to $funcName should all be of type map, but it's " +
children.map(_.dataType.catalogString).mkString("[", ", ", "]"))
} else {
- TypeUtils.checkForSameTypeInputExpr(children.map(_.dataType),
funcName)
+ val sameTypeCheck =
TypeUtils.checkForSameTypeInputExpr(children.map(_.dataType), funcName)
+ if (sameTypeCheck.isFailure) {
+ sameTypeCheck
+ } else {
+ TypeUtils.checkForMapKeyType(dataType.keyType)
--- End diff --
oh, I see. thanks!
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]