Github user maropu commented on a diff in the pull request: https://github.com/apache/spark/pull/21687#discussion_r199386837 --- 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 -- I think we need not use `TypeCoercion.findTightestCommonType`, because we've already checked if the types are same in `checkInputDataTypes`. So, I think it's just ok to consider nullability only?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org