Github user ueshin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/23045#discussion_r234481249
  
    --- 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 --
    
    I don't think we need this. The children already should not have map type 
keys?


---

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

Reply via email to