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

    https://github.com/apache/spark/pull/21687#discussion_r199435426
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala
 ---
    @@ -129,7 +129,7 @@ case class CaseWhen(
         case Seq(dt1, dt2) => dt1.sameType(dt2)
       }
     
    -  override def dataType: DataType = branches.head._2.dataType
    +  override def dataType: DataType = 
valueTypes.reduce(TypeCoercion.findTightestCommonType(_, _).get)
    --- End diff --
    
    As we only need to deal with `StructType`, `ArrayType` and `MapType`, I 
think this method should be much simpler than `findTightestCommonType`?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to